Skip to main content

auto_schema

superduper.misc.auto_schema

Source code

infer_datatype​

infer_datatype(data: Any) -> Union[superduper.components.datatype.DataType,
type,
NoneType]
ParameterDescription
dataThe data object

Infer the datatype of a given data object.

If the data object is a base type, return None, Otherwise, return the inferred datatype

infer_schema​

infer_schema(data: Mapping[str,
Any],
identifier: Optional[str] = None,
ibis=False) -> superduper.components.schema.Schema
ParameterDescription
dataThe data object
identifierThe identifier for the schema, if None, it will be generated
ibisIf True, the schema will be updated for the Ibis backend, otherwise for MongoDB

Infer a schema from a given data object.

register_module​

register_module(module_name)
ParameterDescription
module_nameThe module name, e.g. "superduper.ext.numpy.encoder"

Register a module for datatype inference.

Only modules with a check and create function will be registered

updated_schema_data_for_ibis​

updated_schema_data_for_ibis(schema_data) -> Dict[str,
superduper.components.datatype.DataType]
ParameterDescription
schema_dataThe schema data

Update the schema data for Ibis backend.

Convert the basic data types to Ibis data types.

updated_schema_data_for_mongodb​

updated_schema_data_for_mongodb(schema_data) -> Dict[str,
superduper.components.datatype.DataType]
ParameterDescription
schema_dataThe schema data

Update the schema data for MongoDB backend.

Only keep the data types that can be stored directly in MongoDB.