aminghadersohi commented on code in PR #40776:
URL: https://github.com/apache/superset/pull/40776#discussion_r3416977466
##########
superset/db_engine_specs/bigquery.py:
##########
@@ -742,9 +743,37 @@ def adjust_engine_params(
) -> tuple[URL, dict[str, Any]]:
if catalog:
uri = uri.set(host=catalog, database="")
+ if schema:
+ if not uri.host and uri.database:
+ # Triple-slash form (e.g., bigquery:///project): move the
project
+ # from database to host before setting the default dataset,
otherwise
+ # setting database would overwrite the project.
+ uri = uri.set(host=uri.database, database="")
+ # Setting database to schema enables the BigQuery default dataset
so
+ # unqualified table names resolve to schema.table_name.
+ uri = uri.set(database=schema)
Review Comment:
Done — implemented in commit `0fd0a16072`. Parsing the URI into
`default_catalog`/`default_schema` first and then a single `uri.set()` is much
cleaner. Also updated the catalog-only test to assert on `uri.host` rather than
the exact string representation, which was the only behavioural difference
(trailing slash) from the refactor.
--
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]