kumoai.graph.Column#

class kumoai.graph.Column[source]#

Bases: CastMixin

A column represents metadata information for a column in a Kumo Table. Columns can be created independent of a table, or can be fetched from a table with the column() method.

import kumoai

# Fetch a column from a `kumoai.Table`:
table = kumoai.Table(...)

column = table.column("col_name")
column = table["col_name"]  # equivalent to the above.

# Edit a column's data type:
print("Existing dtype: ", column.dtype)
column.dtype = "int"

# Edit a column's semantic type:
print("Existing stype: ", column.stype)
column.stype = "ID"
Parameters:
  • name (str) – The name of this column.

  • stype (Union[Stype, str, None]) – The semantic type of this column. Semantic types can be specified as strings: the list of possible semantic types is located at Stype.

  • dtype (Union[Dtype, str, None]) – The data type of this column. Data types can be specified as strings: the list of possible data types is located at Dtype.

  • timestamp_format (Union[str, TimestampUnit, None]) – If this column represents a timestamp, the format that the timestamp should be parsed in. The format can either be a TimestampUnit for integer columns or a string with a format identifier described here for a SaaS Kumo deployment and here for a Snowpark Container Services Kumo deployment. If left empty, will be intelligently inferred by Kumo.

__init__(name, stype=None, dtype=None, timestamp_format=None)[source]#