lsst.dax.apdb g9290983e33+ffdc83c6f7
 
Loading...
Searching...
No Matches
lsst.dax.apdb.cassandra.cassandra_utils.ApdbCassandraTableData Class Reference
Inheritance diagram for lsst.dax.apdb.cassandra.cassandra_utils.ApdbCassandraTableData:
lsst.dax.apdb.apdbReplica.ApdbTableData

Public Member Functions

 __init__ (self, list[str] columns, list[tuple] rows)
 
None set_column_types (self, dict[str, felis.datamodel.DataType] types)
 
Sequence[str] column_names (self)
 
Sequence[tuple[str, felis.datamodel.DataType]] column_defs (self)
 
Collection[tuple] rows (self)
 
None append (self, ApdbCassandraTableData other)
 
None project (self, *, Iterable[str] drop=set())
 
Iterator[tuple] __iter__ (self)
 

Protected Attributes

 _columns = columns
 
Collection[tuple] _rows = rows
 
dict _column_types = {}
 

Detailed Description

Implementation of ApdbTableData that wraps Cassandra raw data.

Member Function Documentation

◆ __iter__()

Iterator[tuple] lsst.dax.apdb.cassandra.cassandra_utils.ApdbCassandraTableData.__iter__ ( self)
Make it look like a row iterator, needed for some odd logic.

◆ append()

None lsst.dax.apdb.cassandra.cassandra_utils.ApdbCassandraTableData.append ( self,
ApdbCassandraTableData other )
Extend rows in this table with rows in other table

◆ column_defs()

Sequence[tuple[str, felis.datamodel.DataType]] lsst.dax.apdb.cassandra.cassandra_utils.ApdbCassandraTableData.column_defs ( self)
Return ordered sequence of column names and their types.

Returns
-------
columns : `~collections.abc.Sequence` \
    [`tuple`[`str`, `felis.datamodel.DataType`]]
    Sequence of 2-tuples, each tuple consists of column name and its
    type.

Reimplemented from lsst.dax.apdb.apdbReplica.ApdbTableData.

◆ column_names()

Sequence[str] lsst.dax.apdb.cassandra.cassandra_utils.ApdbCassandraTableData.column_names ( self)
Return ordered sequence of column names in the table.

Returns
-------
names : `~collections.abc.Sequence` [`str`]
    Column names.

Reimplemented from lsst.dax.apdb.apdbReplica.ApdbTableData.

◆ project()

None lsst.dax.apdb.cassandra.cassandra_utils.ApdbCassandraTableData.project ( self,
* ,
Iterable[str] drop = set() )
Modify data in place by droppiing some columns.

◆ rows()

Collection[tuple] lsst.dax.apdb.cassandra.cassandra_utils.ApdbCassandraTableData.rows ( self)
Return table rows, each row is a tuple of values.

Returns
-------
rows : `~collections.abc.Collection` [`tuple`]
    Collection of tuples.

Reimplemented from lsst.dax.apdb.apdbReplica.ApdbTableData.

◆ set_column_types()

None lsst.dax.apdb.cassandra.cassandra_utils.ApdbCassandraTableData.set_column_types ( self,
dict[str, felis.datamodel.DataType] types )
Update column types.

Parameters
----------
types : `dict`[`str`, `felis.datamodel.DataType`]
    Mapping of column name its type.

Notes
-----
Due to the way how instances of this class are constructed it is
impossible to pass types of columns to the constructor, instead we will
need to make a call to this method after construction.

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