pudl_diff.defaults
¶
What the tool knows about PUDL, without depending on it.
Everything here works when the PUDL package isn't installed, by falling back on constants and on PUDL's published outputs. When PUDL is importable, as it is when this runs inside a PUDL environment, its own definitions are used instead, so that they can't drift from these fallbacks. PUDL is only imported when it's needed, never when this module is, so PUDL can itself depend on this tool.
NIGHTLY_ROOT = f's3://{PUDL_CATALYST_COOP_HOST}/nightly/'
module-attribute
¶
The last nightly build's outputs, the reference point most diffs are measured against.
PUDL_CATALYST_COOP_DESCRIPTOR_NAME = 'pudl_parquet_datapackage.json'
module-attribute
¶
What the published outputs at PUDL_CATALYST_COOP_HOST call their
datapackage descriptor, instead of datapackage.json.
PUDL_CATALYST_COOP_HOST = 'pudl.catalyst.coop'
module-attribute
¶
The bucket of PUDL's published outputs, on both S3 and GCS.
default_right_root()
¶
The Parquet outputs of the local PUDL build: $PUDL_OUTPUT/parquet.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If PUDL's output directory can't be determined. |
Source code in src/pudl_diff/defaults.py
fallback_primary_key(table_name)
¶
A table's primary key, when its own dataset can't say.
Tries PUDL's metadata if PUDL is installed, and then the datapackage of the last nightly build. The latter is only fetched if needed, and only once.
Returns:
| Type | Description |
|---|---|
list[str] | None
|
The primary key, an empty list if the table has none, or |
list[str] | None
|
couldn't be found anywhere. |
Source code in src/pudl_diff/defaults.py
nightly_root()
¶
Where the last nightly build's outputs are, readable anonymously.