Data Types
Data types supported by DataChain must be of type
DataType. DataType includes most Python types
supported in Pydantic fields, as well as any class that
inherits from Pydantic BaseModel.
Pydantic models can be used to group and nest multiple fields together into a single
type object. Any Pydantic model must be
registered so that the chain knows the
expected schema of the model. Alternatively, models may inherit from
DataModel, which is a lightweight wrapper
around Pydantic's BaseModel that automatically handles registering the model.
DataModel
Bases: BaseModel
Pydantic model wrapper that registers model with DataChain.
__pydantic_init_subclass__
classmethod
It automatically registers every declared DataModel child class.
Source code in datachain/lib/data_model.py
hidden_fields
classmethod
Returns a list of fields that should be hidden from the user.
Source code in datachain/lib/data_model.py
register
staticmethod
For registering classes manually. It accepts a single class or a sequence of classes.
Source code in datachain/lib/data_model.py
DataType
module-attribute
is_chain_type
Return true if type is supported by DataChain.