Skip to content

Add validator job with BQ differ - #2225

Merged
vish-cs merged 1 commit into
datacommonsorg:masterfrom
vish-cs:helper
Sep 22, 2026
Merged

vish-cs merged 1 commit into
datacommonsorg:masterfrom
vish-cs:helper

Conversation

@vish-cs

@vish-cs vish-cs commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Moves import differ and validation into a standalone Cloud Run Job (dc-import-validator) using a BigQuery SQL differ.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@vish-cs

vish-cs commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a standalone Cloud Run Job entrypoint for the import validator and differ, along with its Dockerfile, Cloud Build configuration, and unit tests. It also updates the import executor to copy import-specific validation configs, adapts the import differ to use BigQuery instead of Dataflow, and updates the validation runner to load differ summaries from CSV files. The review feedback suggests optimizing GCS blob discovery in main.py by using a delimiter to avoid inefficient recursive listing, updating the corresponding unit test mocks, and ensuring the validation runner robustly checks for both differ_summary.csv and obs_diff_summary.csv filenames.

Comment thread import-automation/validator/main.py
Comment thread import-automation/validator/validator_test.py Outdated
Comment thread tools/import_validation/runner.py
@vish-cs
vish-cs force-pushed the helper branch 3 times, most recently from 8046ee0 to 7e2ab9e Compare September 17, 2026 13:01
@vish-cs

vish-cs commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a low-memory, BigQuery-based differ and validation pipeline, including a standalone Cloud Run Job entrypoint, Dockerfile, Cloud Build configuration, and associated unit tests. It also updates the import executor to support uploading custom validation configurations and the validation runner to load differ summaries from CSVs. The review feedback highlights several critical improvements for the BigQuery differ: correctly parsing multi-valued MCF properties as lists to avoid false-positive modifications, implementing a separate validation function for domain-scoped GCP project IDs to prevent validation errors, and adding defensive type checking for the typeOf property to avoid potential TypeErrors.

Comment thread tools/import_differ/bigquery_differ.py
Comment thread tools/import_differ/bigquery_differ.py Outdated
Comment thread tools/import_differ/bigquery_differ.py Outdated
Comment thread tools/import_differ/bigquery_differ.py Outdated
@vish-cs
vish-cs force-pushed the helper branch 3 times, most recently from 65cd777 to 0f18d7e Compare September 17, 2026 13:20
Comment thread tools/import_differ/bigquery_differ.py
Comment thread tools/import_differ/bigquery_differ.py
@vish-cs
vish-cs force-pushed the helper branch 5 times, most recently from 75c7e74 to d0b2d5b Compare September 22, 2026 06:20
@vish-cs
vish-cs enabled auto-merge (squash) September 22, 2026 06:24
@vish-cs
vish-cs merged commit eb4ba50 into datacommonsorg:master Sep 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants