lamindb.base.dtypes
¶
Data types.
Most data types in LaminDB are string-serializable representations of standard Python types, commonly used for validating data in libraries such as pydantic. Categorical data types are absent from built-in Python types and are needed to anchor the validation of a categorical variable in a LaminDB registry.
Simple¶
In the table below, the first column shows the object that
can be passed to the dtype argument of Feature() or Schema() and the second the string serialization
that’s used in the database.
dtype |
string serialization |
pandas |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Categorical/ relational¶
For any categorical, you can restrict permissible values to the values defined in a registry. This establishes a relationship.
dtype |
string serialization |
|---|---|
|
|
|
|
|
|
|
|
You can restrict permissible values to instances of ULabel or Record types, i.e., to dynamic registries.
dtype |
string serialization |
|---|---|
|
|
|
|
You can restrict permissible values by filtering the categorical on fields of its registry.
dtype |
cat_filters |
string serialization |
|---|---|---|
|
|
|
|
|
|
Lists¶
dtype |
string serialization |
|---|---|
|
|
|
|
Unions¶
Unions are currently only supported for static registries.
dtype |
string serialization |
|---|---|
|
|
Usage¶
In features, you can pass dtypes to the dtype argument. See Feature for more details.
In function signatures, you can use dtypes to type annotate and validate arguments.
See Track notebooks, scripts & workflows or flow() for examples.