lsst.dax.apdb g4122c88930+ce54348158
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
lsst.dax.apdb.apdbSchema.ApdbSchema Class Reference
Inheritance diagram for lsst.dax.apdb.apdbSchema.ApdbSchema:
lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema lsst.dax.apdb.apdbSqlSchema.ApdbSqlSchema

Public Member Functions

 __init__ (self, str schema_file, str schema_name="ApdbSchema")
 
Union[type, str] column_dtype (self, Type[felis.types.FelisType] felis_type)
 

Public Attributes

 tableSchemas
 

Protected Member Functions

Mapping[ApdbTables, Table] _buildSchemas (self, str schema_file, str schema_name="ApdbSchema")
 

Detailed Description

Class for management of APDB schema.

Attributes
----------
tableSchemas : `dict`
    Maps table name to `TableDef` instance.

Parameters
----------
schema_file : `str`
    Name of the YAML schema file.
schema_name : `str`, optional
    Name of the schema in YAML files.

Member Function Documentation

◆ _buildSchemas()

Mapping[ApdbTables, Table] lsst.dax.apdb.apdbSchema.ApdbSchema._buildSchemas (   self,
str  schema_file,
str   schema_name = "ApdbSchema" 
)
protected
Create schema definitions for all tables.

Reads YAML schemas and builds dictionary containing `TableDef`
instances for each table.

Parameters
----------
schema_file : `str`
    Name of YAML file with ``felis`` schema.
schema_name : `str`, optional
    Name of the schema in YAML files.

Returns
-------
schemas : `dict`
    Mapping of table names to `TableDef` instances.

◆ column_dtype()

Union[type, str] lsst.dax.apdb.apdbSchema.ApdbSchema.column_dtype (   self,
Type[felis.types.FelisType]  felis_type 
)
Return Pandas data type for a given Felis column type.

Parameters
----------
felis_type : `type`
    Felis type, on of the classes defined in `felis.types` module.

Returns
-------
column_dtype : `type` or `str`
    Type that can be used for columns in Pandas.

Raises
------
TypeError
    Raised if type is cannot be handled.

The documentation for this class was generated from the following file: