temporian.Schema #
A schema defines the type of data in an
EventSetNode
or
EventSet
.
A schema does not contain any actual data.
A schema can be shared by multiple EventSetNodes.
Attributes:
Name | Type | Description |
---|---|---|
features |
List[FeatureSchema]
|
List of feature names and types. |
indexes |
List[IndexSchema]
|
List of index names and types. |
is_unix_timestamp |
bool
|
Whether values correspond to Unix timestamps. |
from_proto
classmethod
#
from_proto(proto: 'serialization.pb.Schema') -> 'Schema'
Creates a schema from a protobuf.
from_proto_file
classmethod
#
from_proto_file(path: str) -> 'Schema'
Creates a schema from a file text protobuf.
to_proto #
to_proto() -> 'serialization.pb.Schema'
Converts the schema into a protobuf.
Usage example
schema = tp.Schema(features=[("f1",int), (f2, float)])
proto_schema = schema.to_proto()
restored_schema = tp.Schema.from_proto(proto_schema)
to_proto_file #
to_proto_file(path: str) -> None
Save the schema to a file with text protobuf format.
Usage example
schema = tp.Schema(features=[("f1",int), (f2, float)])
path = "/tmp/my_schema.pbtxt"
schema.to_proto_file(path)
restored_schema = tp.Schema.from_proto_file(path)