Data Types
tecton_client.data_types module
- class tecton_client.data_types.ArrayType(element_type: DataType)[source]
Bases:
DataType
Class to represent datatype Array.
An
ArrayType
object represents an array datatype that can contain elements of anotherDataType
.Examples
>>> element_type = FloatType() >>> array_type = ArrayType(element_type) >>> print(array_type) Array(Float)
- class tecton_client.data_types.BoolType[source]
Bases:
DataType
Class to represent datatype Boolean.
- class tecton_client.data_types.DataType[source]
Bases:
ABC
Base DataType class. All data types inherit from this class.
- class tecton_client.data_types.NameAndType(name: str, data_type: DataType)[source]
Bases:
object
Class to represent a name and data type pair.
- data_type: DataType
- name: str
- class tecton_client.data_types.StringType[source]
Bases:
DataType
Class to represent datatype String.
- class tecton_client.data_types.StructField(name: str, data_type: DataType)[source]
Bases:
object
Class to represent a field in a
StructType
.A
StructField
object represents a field within aStructType
object, containing a name and a correspondingDataType
.- property name: str
Return the name of the field.
- class tecton_client.data_types.StructType(fields: List[StructField])[source]
Bases:
DataType
Class to represent datatype Struct.
A
StructType
object represents a struct datatype, consisting of multiple fields.Examples
>>> field1 = StructField("name", StringType()) >>> field2 = StructField("age", IntType()) >>> struct_type = StructType([field1, field2]) >>> print(struct_type) Struct(Field(name, String), Field(age, Int))
- property fields: List[StructField]
Return the list of
StructField
objects representing the fields in the struct.
- tecton_client.data_types.get_data_type(data_type: str, element_type: dict | None = None, fields: list | None = None) DataType [source]
Get the
DataType
of the feature value given a string representing the type in the response.- Parameters:
data_type (str) – A string representing the type of the feature value, as returned in the response.
element_type (Optional[dict]) – A dict representing the type of the elements in the array, present when the data_type is
ArrayType
.fields (Optional[list]) – A list representing the fields of the struct, present when the data_type is
StructType
- Returns:
The parsed
DataType
of the feature value.- Return type:
- Raises:
TectonClientError – If an unexpected error occurred while processing the data types in the response.
|
Base DataType class. |
|
Class to represent datatype Integer. |
Class to represent datatype Float. |
|
Class to represent datatype String. |
|
|
Class to represent datatype Boolean. |
|
Class to represent datatype Array. |
|
Class to represent a field in a |
|
Class to represent datatype Struct. |
|
Class to represent a name and data type pair. |