eschutho opened a new pull request, #45634:
URL: https://github.com/apache/superset/pull/45634
### SUMMARY
**Root cause:** `DatabaseRestApi.table_extra_metadata` calls
`BigQueryEngineSpec.get_extra_table_metadata`, which calls
`get_time_partition_column` -> `client.get_table(...)`. If the table no longer
exists in BigQuery (dropped, renamed, stale reference),
`google.api_core.exceptions.NotFound` propagates and the endpoint returns a
500. Verified `BigQueryEngineSpec` overrides `get_extra_table_metadata` and
this is the path the API executes (both `table_extra_metadata` endpoints in
`databases/api.py` call it).
**Fix:** catch `NotFound` (only) around the partition-column lookup in
`get_extra_table_metadata`, log a warning, and return an empty payload.
Partition/index info is optional enrichment, so the UI simply shows no extra
metadata. Other errors (e.g. 403 Forbidden) still propagate. No change for
other engines. `get_time_partition_column` itself is unchanged, so
`where_latest_partition` / `select_star` behavior is untouched.
**Tradeoffs:** a missing table now yields a 200 with empty metadata instead
of a 500 — a deliberate error-to-degrade failure-mode change. Callers can no
longer distinguish "table missing" from "table has no partitions" via this
endpoint; the condition is logged at WARNING.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
### TESTING INSTRUCTIONS
`pytest tests/unit_tests/db_engine_specs/test_bigquery.py` (73 passed). New
tests: NotFound -> `{}` with no raise; Forbidden still raises; partitioned
happy path unchanged. The NotFound test fails without the fix and passes with
it. `ruff check`/`ruff format` clean.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]