hats.catalog.dataset.collection_properties#

Classes#

CollectionProperties

Container class for catalog metadata

Module Contents#

class CollectionProperties(/, **data: Any)[source]#

Bases: hats.catalog.dataset.hats_properties.HatsProperties

Container class for catalog metadata

name: str[source]#
hats_primary_table_url: str[source]#

Reference to object catalog. Relevant for nested, margin, association, and index.

all_margins: Annotated[list[str] | None, Field(default=None), PlainSerializer(HatsProperties.serialize_list_as_space_delimited_list), BeforeValidator(HatsProperties.space_delimited_list)][source]#
default_margin: str | None[source]#
all_indexes: Annotated[dict[str, str] | None, Field(default=None), PlainSerializer(HatsProperties.serialize_dict_as_space_delimited_list)][source]#
default_index: str | None[source]#
all_extensions: Annotated[dict[str, str] | None, Field(default=None), PlainSerializer(HatsProperties.serialize_dict_as_space_delimited_list)][source]#

Extensions of this collection, each holding a set of additional columns, and described by an <extension>.properties file. Maps the alias of each extension to the path to that file, relative to the collection root or absolute.

classmethod space_delimited_dict(str_value: str, info: pydantic.ValidationInfo) → dict[str, str][source]#

Convert a space-delimited list string of key-value pairs into a python dict of strings.

Parameters:
str_value: str

a space-delimited list string

info: ValidationInfo

information about the field being validated

Returns:
dict[str, str]

a python dict of strings

Raises:
ValueError

if the string list has an odd number of elements (and so is not pairs of name and path)

check_default_margin_exists() → Self[source]#

Check that the default margin is in the list of all margins.

check_default_index_exists() → Self[source]#

Check that the default index is in the list of all indexes.

check_extension_paths() → Self[source]#

Check that each extension is listed by the path to its properties file.

classmethod read_from_dir(catalog_dir: str | pathlib.Path | upath.UPath) → Self[source]#

Read field values from a java-style properties file.

Parameters:
catalog_dir: str | Path | UPath

base directory of catalog.

Returns:
CollectionProperties

new object from the contents of a collection.properties file in the directory.

to_properties_file(catalog_dir: str | pathlib.Path | upath.UPath)[source]#

Write fields to a java-style properties file.

Parameters:
catalog_dir: str | Path | UPath

base directory of catalog.