Repository navigation
Conversation
Data Commons Platform 1.1.6 deletes the Cloud Run preprocessing job, and dcp-tools 1.1.0 starts the ingestion workflow without its name. KnowledgeGraphResource loses prep_job_name, definitions.py stops reading DCP_PREP_JOB_NAME, and .env.example and the test fixtures drop it. The provenance expectation in test_export.py follows dcp-tools 1.1.0, which writes importedSourceReleaseDate as a declared Provenance field.
ingest_bundle checks the DCP workflow contract with dcp-tools before it uploads anything, so a stack older than 1.1.6 gets no bundle and the run fails with WorkflowContractError. After starting the workflow it watches the execution for up to two minutes and fails the run on a FAILED or CANCELLED state. Each ingestion asset records the execution name as metadata. The GCS client gets the project explicitly. KnowledgeGraphResource builds dcp-tools settings from its own values only, so environment variables such as GCS_INPUT_FOLDER_PATH no longer override it. The export passes the source release date through add_provenance's imported_source_release_date keyword. Tests share one knowledge_graph fixture and compare provenance as parsed properties.
dcp-tools 1.1.0 starts ingestion on Data Commons Platform 1.1.6 and pulls in datacommons-admin 1.1.6, which caps setuptools at 80.0.0. resources.py imports pydantic_settings directly, so declare it.
jm-rivera
marked this pull request as ready for review
October 23, 2026 18:45
tillywoodfield
requested changes
Oct 26, 2026
tillywoodfield
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @jm-rivera! I've released dcp-tools 1.2.0, which includes changes that enable us to drop a few things from this PR. Please could this PR move to dcp-tools>=1.2.0 and keep to what the upgrade needs, with the rest as follow-up PRs, so each is easier to review?
For the upgrade itself:
- Require
dcp-tools>=1.2.0. - Drop
prep_job_namefromKnowledgeGraphResource,DCP_PREP_JOB_NAMEfromdefinitions.pyand.env.example, and the test arguments, with the sharedknowledge_graphfixture since those lines change anyway. - Drop
local_path=Path("."),gcs_output_folder_path=""and their comment fromKnowledgeGraphResource.settings, since both are optional in 1.2.0. - Call
check_ingestion_workflow_contractbefore the sync, so a bundle never uploads to a stack older than 1.1.6. - Add the README's line on
roles/workflows.viewer, which the contract check needs.
For follow-ups:
- Watching the execution and recording
execution_namemetadata on the 11 assets. On 1.2.0,watch_execution_startbecomes a call towait_for_ingestion(settings, execution_name, timeout=watch_seconds, poll_interval=poll_seconds). It returns the terminal state, includingFAILEDandCANCELLED, and raisesTimeoutErrorwhen the watch runs out, whichingest_bundlecan treat as the execution still running. That drops thesleepandclockparameters and the fake-clock tests. - Passing the source release date through
add_provenance'simported_source_release_date, with the provenance test that compares parsed properties. - Passing
project=settings.gcp_project_idtoget_gcs_client. _ResourceKGSettings, which shuts out environment variables as well as.env, and thepydantic-settingsdependency it brings. KGSettings ignores undeclared.envvariables in 1.2.0, so only the environment part is left to decide.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Data Commons Platform 1.1.6 deletes the Cloud Run preprocessing job, and dcp-tools 1.1.0 (ONEcampaign/dcp-tools#197) starts the ingestion workflow without its name.
KnowledgeGraphResourcelosesprep_job_name,definitions.pystops readingDCP_PREP_JOB_NAME, and.env.exampledrops it. The resource builds dcp-tools settings from its own values only, through a subclass whosesettings_customise_sourceskeeps init values, so environment variables such asGCS_INPUT_FOLDER_PATHno longer override it.ingest_bundleinsrc/dfo_pipelines/data_commons/ingestion.pycallscheck_ingestion_workflow_contractbefore uploading, so a stack older than 1.1.6 receives nothing and the run fails withWorkflowContractError. It then starts the workflow, watches the execution for up to 120 s at 5 s intervals, and fails the run onFAILEDorCANCELLEDwith the execution's error. Each of the 11 ingestion assets recordsexecution_namemetadata besidedagster/uri. The GCS client getsproject=settings.gcp_project_id. The export passes the source release date throughadd_provenance'simported_source_release_datekeyword. Tests share oneknowledge_graphfixture intests/conftest.pyand compare provenance as parsed properties. The README's Ingestion section covers the watch, the metadata and theroles/workflows.viewerrequirement.The branch requires
dcp-tools>=1.1.0and declarespydantic-settings, whichresources.pyimports directly. The lock gainsdatacommons-admin1.1.6 anddatacommons-db, and setuptools drops from 83.0.0 to 80.0.0 underdatacommons-db's cap. Merge after DevelopmentFinanceObservatory/infra#61 applies on dev, then removeDCP_PREP_JOB_NAMEfrom the Dagster deployment.dcp-tools 1.1.0 leaves logging to the importing application, so its INFO lines reach a run log only if the deployed code location captures the root or
dcp_toolslogger, as.dagster_home/dagster.yamldoes locally. The execution name is in asset metadata either way.Testing: after
uv sync --lockedagainst dcp-tools 1.1.0 from PyPI, pytest passes 444 of 444,ruff check,ruff format --check,ty checkandsqlfluff lintare clean,dg check defsloads every definition, anddbt buildon the CI fixtures passes 1138 nodes. No ingestion was run.