pudl.etl.check_foreign_keys#

A command line interface (CLI) to check foreign key constraints in the PUDL database.

Assets are executed once their upstream dependencies have been executed. However, this order is non deterministic because they are executed in parallel. This means the order that tables are loaded into pudl.sqlite will not satisfy foreign key constraints.

Foreign key constraints on pudl.sqlite are disabled so dagster can load tables into the database without a foreign key error being raised. However, foreign key constraints can be evaluated after all of the data has been loaded into the database. To check the constraints, run the pudl_check_fks cli command once the data has been loaded into pudl.sqlite.

Module Contents#

Functions#

parse_command_line(argv)

Parse script command line arguments. See the -h option.

main()

Parse command line and check PUDL foreign key constraints.

Attributes#

pudl.etl.check_foreign_keys.logger[source]#
pudl.etl.check_foreign_keys.parse_command_line(argv)[source]#

Parse script command line arguments. See the -h option.

Parameters:

argv (list) – command line arguments including caller file name.

Returns:

A dictionary mapping command line arguments to their values.

Return type:

dict

pudl.etl.check_foreign_keys.main()[source]#

Parse command line and check PUDL foreign key constraints.