pandera.api.xarray.container.DataTreeSchemaΒΆ
- class pandera.api.xarray.container.DataTreeSchema(children=None, dataset=None, attrs=None, checks=None, strict=False, name=None, title=None, description=None, metadata=None)[source]ΒΆ
Validate an
xarray.DataTree.A
DataTreeis a hierarchical tree of datasets. This schema validates both the node-level dataset (viadataset) and the child nodes (viachildren). Children can be specified by direct name or/-separated paths.Initialize a DataTreeSchema.
- Parameters:
children (
UnionType[dict[str,UnionType[DatasetSchema,DataTreeSchema]],None]) β mapping of child node names (or/-separated paths) toDatasetSchemaorDataTreeSchema.dataset (
UnionType[DatasetSchema,None]) β schema for the dataset at this node.attrs (
UnionType[dict[str,Any],None]) β expected node-level attributes.checks (
Union[Check,list[Union[Check,Hypothesis]],None]) β checks applied to the tree node.strict (
bool) β if True, fail on unexpected child nodes.title (
UnionType[str,None]) β A human-readable label for the schema.description (
UnionType[str,None]) β An arbitrary textual description of the schema.metadata (
UnionType[dict,None]) β An optional key-value data.
Attributes
BACKEND_REGISTRYpropertiesGet the properties of the schema for serialization purposes.
Methods
- __init__(children=None, dataset=None, attrs=None, checks=None, strict=False, name=None, title=None, description=None, metadata=None)[source]ΒΆ
Initialize a DataTreeSchema.
- Parameters:
children (
UnionType[dict[str,UnionType[DatasetSchema,DataTreeSchema]],None]) β mapping of child node names (or/-separated paths) toDatasetSchemaorDataTreeSchema.dataset (
UnionType[DatasetSchema,None]) β schema for the dataset at this node.attrs (
UnionType[dict[str,Any],None]) β expected node-level attributes.checks (
Union[Check,list[Union[Check,Hypothesis]],None]) β checks applied to the tree node.strict (
bool) β if True, fail on unexpected child nodes.title (
UnionType[str,None]) β A human-readable label for the schema.description (
UnionType[str,None]) β An arbitrary textual description of the schema.metadata (
UnionType[dict,None]) β An optional key-value data.
- static register_default_backends(check_obj_cls)[source]ΒΆ
Register default backends.
This method is invoked in the get_backend method so that the appropriate validation backend is loaded at validation time instead of schema-definition time.
This method needs to be implemented by the schema subclass.