pandera.decorators.check_ioΒΆ

pandera.decorators.check_io(head=None, tail=None, sample=None, random_state=None, lazy=False, inplace=False, out=None, **inputs)[source]ΒΆ

Check schema for multiple inputs and outputs.

See here for more usage details.

Parameters:
  • head (Optional[int, None]) – validate the first n rows. Rows overlapping with tail or sample are de-duplicated.

  • tail (Optional[int, None]) – validate the last n rows. Rows overlapping with head or sample are de-duplicated.

  • sample (Optional[int, None]) – validate a random sample of n rows. Rows overlapping with head or tail are de-duplicated.

  • random_state (Optional[int, None]) – random seed for the sample argument.

  • lazy (bool) – if True, lazily evaluates dataframe against all validation checks and raises a SchemaErrors. Otherwise, raise SchemaError as soon as one occurs.

  • inplace (bool) – if True, applies coercion to the object of validation, otherwise creates a copy of the data.

  • out (Union[DataFrameSchema, ComponentSchema, Tuple[Union[str, int, Callable], Union[DataFrameSchema, ComponentSchema]], List[Tuple[Union[str, int, Callable], Union[DataFrameSchema, ComponentSchema]]], None]) – this should be a schema object if the function outputs a single dataframe/series. It can be a two-tuple, where the first element is a string, integer, or callable that fetches the pandas data structure in the output, and the second element is the schema to validate against. For multiple outputs, specify a list of two-tuples following the above structure.

  • inputs (Union[DataFrameSchema, ComponentSchema]) – kwargs keys should be the argument name in the decorated function and values should be the schema used to validate the pandas data structure referenced by the argument name.

Return type:

Callable[[~F], ~F]

Returns:

wrapped function