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 DataTree is a hierarchical tree of datasets. This schema validates both the node-level dataset (via dataset) and the child nodes (via children). Children can be specified by direct name or /-separated paths.

Initialize a DataTreeSchema.

Parameters:

Attributes

BACKEND_REGISTRY

properties

Get 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:
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.

validate(check_obj, head=None, tail=None, sample=None, random_state=None, lazy=False, inplace=False)[source]ΒΆ

Validate a DataTree.

Parameters:
  • check_obj (DataTree) – the DataTree to validate.

  • lazy (bool) – if True, collect all errors before raising.

Return type:

DataTree

Returns:

validated DataTree.