fix(bigquery): preserve catalog in partition metadata lookup#40200
fix(bigquery): preserve catalog in partition metadata lookup#40200puneetdixit200 wants to merge 1 commit into
Conversation
Code Review Agent Run #49e3b4Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes BigQuery partition column lookup to include the project (catalog) in the fully-qualified table reference, ensuring partition metadata is retrieved from the correct project rather than the connection's default.
Changes:
- Prepend
table.catalogto the BigQuery table reference passed toclient.get_tablewhen available. - Add a unit test verifying the catalog is included in the table reference.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| superset/db_engine_specs/bigquery.py | Build table reference as catalog.schema.table when catalog is present. |
| tests/unit_tests/db_engine_specs/test_bigquery.py | New test asserting catalog-qualified table reference is used. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40200 +/- ##
==========================================
- Coverage 64.16% 64.16% -0.01%
==========================================
Files 2591 2591
Lines 138162 138165 +3
Branches 32048 32049 +1
==========================================
Hits 88649 88649
- Misses 47984 47987 +3
Partials 1529 1529
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
SUMMARY
Preserve the BigQuery project/catalog when looking up time partition metadata.
get_time_partition_columnpreviously calledclient.get_table()with onlydataset.table, so the BigQuery clientcould fall back to the credentials/default project and return a 404 for cross-project datasets. The lookup now uses
project.dataset.tablewhenTable.catalogis available.Fixes #40131
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable.
TESTING INSTRUCTIONS
Automated checks:
venv\Scripts\python.exe -m pytest tests\unit_tests\db_engine_specs\test_bigquery.py -qvenv\Scripts\python.exe -m ruff format --check superset\db_engine_specs\bigquery.py tests\unit_tests\db_engine_specs\test_bigquery.pyvenv\Scripts\python.exe -m ruff check superset\db_engine_specs\bigquery.py tests\unit_tests\db_engine_specs\test_bigquery.pygit diff --checkManual verification:
ADDITIONAL INFORMATION