aminghadersohi commented on code in PR #40776:
URL: https://github.com/apache/superset/pull/40776#discussion_r3414770512


##########
superset/db_engine_specs/bigquery.py:
##########
@@ -742,6 +742,15 @@ 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

Review Comment:
   Good catch. Fixed in de1331ce12: added `supports_dynamic_schema = True` to 
`BigQueryEngineSpec`. Since `adjust_engine_params` now rewrites `uri.database` 
per-query when a schema is provided, this flag is required so 
`get_default_schema_for_query` returns `query.schema` for permission checks 
rather than falling back to the static URI value — keeping security checks 
aligned with actual query execution.



-- 
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]

Reply via email to