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:
wrapped β the function to decorate.
head (
UnionType[int,None]) β validate the first n rows. Rows overlapping with tail or sample are de-duplicated.tail (
UnionType[int,None]) β validate the last n rows. Rows overlapping with head or sample are de-duplicated.sample (
UnionType[int,None]) β validate a random sample of n rows. Rows overlapping with head or tail are de-duplicated.random_state (
UnionType[int,None]) β random seed for thesampleargument.lazy (
bool) β if True, lazily evaluates dataframe against all validation checks and raises aSchemaErrors. Otherwise, raiseSchemaErroras 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