This method finds the tables of a source, selects them with the applies_to= selector, and validates each one with the standard’s steps (as validate() does). Each table gets a validation of its own, named with the table’s name, so a table that fails doesn’t stop the others from being validated. The results come back in a StandardResult, which shows all the validations in one report and tells which tables failed.
The tables are found when the method is called, so applying a standard on a schedule validates new tables as they appear.
Parameters
source:Any
The tables: a dictionary of names to tables, an Ibis connection or a connection string, a directory, a glob pattern, or a list of files (see the Sources of Tables section of Standard).
applies_to:TableSelector | None=None
A table selector that’s used instead of the standard’s applies_to=. If neither is given, every table of the source is validated.
Returns
StandardResult
The validations of the tables, in the order of the source. A table that couldn’t be read is in its errors instead.
Raises
TypeError
If source= isn’t one of the kinds of sources, or a step’s arguments don’t fit its validation method.
FileNotFoundError
If source= is a path that doesn’t exist.
Warns
UserWarning
If no table of the source is selected (the result is then empty).
Examples
Let’s set up a DuckDB database with a few tables in two schemas: the tables of the default schema (main) are raw extracts, and the marts schema has the tables that analysts use.
Our standard for dimension tables says that each must have unique rows and that its columns are complete. It applies to the tables of the marts schema whose names start with "dim_".