pudl.dagster.resources#
Dagster resources for PUDL.
This module defines the configurable resources that PUDL assets depend on at runtime,
such as data configuration, datastore access, and other run-scoped helpers, along with
the default resource mapping used by the assembled code location. Add
dagster.ConfigurableResource classes and configured singleton instances here
when they provide external services or shared runtime context to assets and jobs. Keep
asset logic out of this module; it should focus on dependency injection and default
resource wiring.
For the underlying Dagster concept, see https://docs.dagster.io/guides/build/external-resources
Attributes#
Classes#
Load the input/output paths used by Dagster-managed PUDL runs. |
|
Encodes runtime settings for the ferc_to_sqlite graphs. |
|
Load validated PUDL data configuration from a shared ETL YAML file. |
|
Load the canonical Zenodo DOI settings for Dagster-managed runs. |
|
Dagster resource to interact with Zenodo archives. |
|
Configure which archived FERC EQR filings are available for extraction. |
|
Send notifications to Zulip streams via the Zulip API. |
Module Contents#
- class pudl.dagster.resources.PudlPathsResource[source]#
Bases:
dagster.ConfigurableResourceLoad the input/output paths used by Dagster-managed PUDL runs.
Explicit Dagster resource config takes precedence. Any unset field falls back to the current process environment so dg runs, local .env files, test fixtures, and container-provided environment variables all share a single typed entry point.
- create_resource(context) pudl.workspace.setup.PudlPaths[source]#
Create validated runtime path settings for the current Dagster run.
- class pudl.dagster.resources.FercXbrlRuntimeSettings[source]#
Bases:
dagster.ConfigurableResourceEncodes runtime settings for the ferc_to_sqlite graphs.
- class pudl.dagster.resources.GlobalDataConfigResource[source]#
Bases:
dagster.ConfigurableResourceLoad validated PUDL data configuration from a shared ETL YAML file.
- create_resource(context) pudl.settings.GlobalDataConfig[source]#
Create runtime data configuration from the configured YAML file.
- class pudl.dagster.resources.ZenodoDoiSettingsResource[source]#
Bases:
dagster.ConfigurableResourceLoad the canonical Zenodo DOI settings for Dagster-managed runs.
Two configuration paths are supported:
Inline defaults (
zenodo_dois_path=None): uses the canonical Zenodo DOIs that are hardcoded as defaults inZenodoDoiSettings. This is the normal production path — no extra config file is needed.Path override (
zenodo_dois_path="..."): loads DOIs from an external YAML file, allowing deployments or tests to substitute different DOIs without modifying the source code.
- create_resource(context) pudl.workspace.datastore.ZenodoDoiSettings[source]#
Create runtime DOI settings, optionally from an override YAML file.
- class pudl.dagster.resources.DatastoreResource[source]#
Bases:
dagster.ConfigurableResourceDagster resource to interact with Zenodo archives.
- zenodo_dois: dagster.ResourceDependency[ZenodoDoiSettingsResource][source]#
- pudl_paths: dagster.ResourceDependency[PudlPathsResource][source]#
- create_resource(context) pudl.workspace.datastore.Datastore[source]#
Create a configured datastore runtime object.
- class pudl.dagster.resources.FercEqrDataConfig[source]#
Bases:
dagster.ConfigurableResourceConfigure which archived FERC EQR filings are available for extraction.
The default value of
ferceqr_archive_uripoints to the published archive of FERC EQR filings on GCS which is what we use in production. For testing or development, this can be overridden to point to a local path with a subset of the archive.
- class pudl.dagster.resources.ZulipNotificationResource[source]#
Bases:
dagster.ConfigurableResourceSend notifications to Zulip streams via the Zulip API.
- send_stream_message(*, stream: str, topic: str, content: str, file_path: str | pathlib.Path | None = None) dict[source]#
Send a message to a Zulip stream topic and return the API response.
Optionally upload a file and attach a download link to the message content.
Sends are best-effort: all failures are logged as warnings and returned in the result dict so callers can inspect them, but no exception is raised. This ensures a notification hiccup never crashes an asset.