ApdbSchema

class lsst.dax.apdb.ApdbSchema(schema_file: str, schema_name: str = 'ApdbSchema')

Bases: object

Class for management of APDB schema.

Parameters:
schema_filestr

Name of the YAML schema file.

schema_namestr, optional

Name of the schema in YAML files.

Attributes:
tableSchemasdict

Maps table name to TableDef instance.

Methods Summary

column_dtype(felis_type)

Return Pandas data type for a given Felis column type.

schemaVersion()

Return schema version as defined in YAML schema file.

Methods Documentation

column_dtype(felis_type: type[felis.types.FelisType]) type | str

Return Pandas data type for a given Felis column type.

Parameters:
felis_typetype

Felis type, on of the classes defined in felis.types module.

Returns:
column_dtypetype or str

Type that can be used for columns in Pandas.

Raises:
TypeError

Raised if type is cannot be handled.

schemaVersion() VersionTuple

Return schema version as defined in YAML schema file.

Returns:
versionVersionTuple

Version number read from YAML file, if YAML file does not define schema version then “0.1.0” is returned.