Collection.validate#

classmethod Collection.validate(
data: Mapping[str, FrameType],
/,
*,
cast: bool = False,
eager: bool = True,
) Self[source]#

Validate that a set of data frames satisfy the collection’s invariants.

Parameters:
  • data – The members of the collection which ought to be validated. The dictionary must contain exactly one entry per member with the name of the member as key.

  • cast – Whether columns with a wrong data type in the member data frame are cast to their schemas’ defined data types if possible.

  • eager – Whether the validation should be performed eagerly. If True, this method raises a validation error and the returned collection contains “shallow” lazy frames, i.e., lazy frames by simply calling lazy() on the validated data frame. If False, this method only raises a ValueError if data does not contain data for all required members. The returned collection contains “true” lazy frames that will be validated upon calling collect() on the individual member or collect_all() on the collection. Note that, in the latter case, information from error messages is limited.

Raises:
  • ValueError – If an insufficient set of input data frames is provided, i.e. if any required member of this collection is missing in the input.

  • ValidationError – If eager=True and any of the input data frames does not satisfy its schema definition or the filters on this collection result in the removal of at least one row across any of the input data frames. If eager=False, a ComputeError is raised upon collecting.

Returns:

An instance of the collection. All members of the collection are guaranteed to be valid with respect to their respective schemas and the filters on this collection did not remove rows from any member. The input order of each member is maintained.