Collection.validate#
- classmethod Collection.validate( ) 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 callinglazy()on the validated data frame. IfFalse, this method only raises aValueErrorifdatadoes not contain data for all required members. The returned collection contains “true” lazy frames that will be validated upon callingcollect()on the individual member orcollect_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=Trueand 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. Ifeager=False, aComputeErroris 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.