fix(bigquery): preserve catalog in partition metadata lookup#40200
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.40% 64.36% -0.05%
==========================================
Files 2653 2653
Lines 145325 145128 -197
Branches 33548 33467 -81
==========================================
- Hits 93593 93407 -186
+ Misses 50034 50023 -11
Partials 1698 1698
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rusackas
left a comment
There was a problem hiding this comment.
This is a clean fix. Just updated the branch to see if CI will pass.
Without the catalog prefix, client.get_table("dataset.table") resolves against the client's default project, so partition metadata gets silently missed for tables in another BigQuery project, and the qualified project.dataset.table reference is exactly right. The guard keeps the no-catalog path unchanged and the unit test pins the resolved reference.
Will merge soon if all goes well!
|
| Language | Fuzzy before | Fuzzy after | New |
|---|---|---|---|
fr |
1004 | 1014 | +10 |
How to fix
1. Install dependencies (if not already set up):
pip install -r superset/translations/requirements.txt
sudo apt-get install gettext # or: brew install gettext2. Re-extract strings and sync .po files:
./scripts/translations/babel_update.shThis rewrites superset/translations/messages.pot from the current source files and merges the changes into every .po file. Strings whose msgid changed will be marked #, fuzzy.
3. Resolve the fuzzy entries in the affected language files (fr):
grep -n '#, fuzzy' superset/translations/<lang>/LC_MESSAGES/messages.poFor each fuzzy entry, either rewrite the msgstr to match the new string and remove the #, fuzzy line, or clear the msgstr to "" if you cannot provide a translation.
4. Commit your changes to the .po files.
…40200) Co-authored-by: Puneet Dixit <[email protected]> Co-authored-by: Evan Rusackas <[email protected]>
|
Bito Automatic Review Skipped – PR Already Merged |
…40200) Co-authored-by: Puneet Dixit <[email protected]> Co-authored-by: Evan Rusackas <[email protected]>
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