dosubot[bot] commented on issue #40131: URL: https://github.com/apache/superset/issues/40131#issuecomment-4455388474
<!-- Greeting --> Hi @colemandsmith! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> This is a confirmed bug. The issue is in `get_time_partition_column` at [line 365](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/db_engine_specs/bigquery.py#L365) where the table reference is constructed as a 2-part string: ```python bq_table = client.get_table(f"{table.schema}.{table.table}") ``` This omits `table.catalog` (which maps to the BigQuery project ID), so the client falls back to the credentials' default project — causing the 404 for cross-project datasets. Other methods in the same file handle this correctly. For example, `df_to_sql` uses the full 3-part reference via `str(table)` [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/db_engine_specs/bigquery.py#L453), and `get_max_partition_id` constructs a qualified path including the catalog when present [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/db_engine_specs/bigquery.py#L324). The fix would be to include the catalog in the table reference when available: ```python table_ref = ( f"{table.catalog}.{table.schema}.{table.table}" if table.catalog else f"{table.schema}.{table.table}" ) bq_table = client.get_table(table_ref) ``` A related cross-project issue was previously addressed in PR #34360 for SQLAlchemy table construction [[3]](https://github.com/apache/superset/pull/34360), but that fix didn't cover this specific BigQuery client API call path. A maintainer-suggested workaround in the meantime is to create a virtual dataset with a fully-qualified table reference [[4]](https://github.com/apache/superset/issues/33465): ```sql SELECT `col` FROM `projectId`.`dataset`.`table_name` ``` though this has the downside of Superset running predicates as subqueries. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fsuperset&message_id=664049f0-fb2e-487d-bea0-803ba18effb2) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fsuperset) -- 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]
