aminghadersohi opened a new pull request, #40776:
URL: https://github.com/apache/superset/pull/40776
## Summary
`BigQueryEngineSpec.adjust_engine_params()` previously ignored the `schema`
parameter entirely. BigQuery requires table names to be fully qualified
(`project.dataset.table`) unless a default dataset is set via the SQLAlchemy
URL `database` component (`bigquery://project/dataset`). When `schema` is not
propagated to the URL, any SQL that uses unqualified table names fails with:
> Table must be qualified with a dataset
### Fix
Set the URL `database` component from `schema` so unqualified table names in
SQL resolve to `schema.table_name`:
```python
if schema:
uri = uri.set(database=schema)
```
- When both `catalog` and `schema` are provided: `catalog` sets the host
(project), `schema` sets the database (default dataset)
- Adds unit tests covering schema-only, catalog-only, and catalog+schema
combinations
## Testing
```
pytest
tests/unit_tests/db_engine_specs/test_bigquery.py::test_adjust_engine_params_schema_as_dataset
-v
```
--
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]