esgungor opened a new issue, #33465:
URL: https://github.com/apache/superset/issues/33465

   ### Bug description
   
   
   **Describe the bug**
   When configuring a BigQuery database connection in Superset using a service 
account, the generated SQL queries fail if the service account's project ID is 
different from the project ID where the target BigQuery dataset and table 
reside.
   
   The BigQuery connector appears to generate table references in the format `` 
`dataset`.`table_name` ``. While this works when querying tables within the 
same project as the service account, cross-project queries require the format 
`` `projectId`.`dataset`.`table_name` ``. The missing project ID in the 
generated query prevents successful execution.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. Configure a new BigQuery database connection in Superset.
   2. Select "Service Account" as the authentication method.
   3. Modify SQLAlchemy to seperate billing_project_id and project_id. It still 
waiting 
[approve](https://github.com/googleapis/python-bigquery-sqlalchemy/pull/1180) 
   4. Use a service account whose project ID is `project-A`.
   5. Add a dataset and table from a *different* project, say `project-B`, to 
Superset.
   6. Attempt to run a query or create a chart using the table from `project-B`.
   
   **Actual behavior**
   The query fails with an error (likely related to permissions or table not 
found), because the generated SQL omits the required project ID for 
cross-project access, like:
   
   ```sql
   SELECT `column` FROM `dataset`.`table_name`
   ```
   **Proposed Solution**
   A query that includes the project ID format works correctly:
   ```sql
    SELECT `example` AS `example` FROM `projectId`.`dataset`.`table_name`
   ```
   
   Environment:
   
   Superset version:4.1.2
   
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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