-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(bigquery): create read session with client or job projectID #10932
fix(bigquery): create read session with client or job projectID #10932
Conversation
@juanli16 @fsaintjacques I think this should have been the default behavior in the first place, which solves for your use cases and doesn't require to add overrides. Let me know if makes sense. |
@alvarowolfx I don't mind the fix since it won't break our use case, but beware that this might break (due to IAM) the existing users of this library. |
@fsaintjacques thanks for raising the concern. I think was a mistake in the first place to use the table projectID to create session, as for the basic use case of reading public datasets, would fail with this approach. Other than that, I think I can see two major groups here:
Do you see any other scenario that would break ? In any case, I think we can move with PR #10924 in parallel, to allow users to set the project used to create sessions. |
Nope, I don't foresee any other issues. I wanted to warn you that this was potentially breaking some existing (un)lucky setup. |
When reading result sets using the Storage Read API Acceleration enabled, currently the read session is created by default in the table's project. This works for cases where the destination table is not specified and automatically created, which defaults to the project where the the query or job was created. But when reading a table directly or specifying a destination table, it doesn't work in cases where the client doesn't have BQ Storage permissions (just table read permission for example). This is a common use case where some customers have a main billing project and this project has access to other GCP projects with just permission to read data from BigQuery tables.
With this PR, we default to use the defined Query/Job projectID (which defaults to the current
bigquery.Client.projectID
or when reading the a table directly, we also use default to thebigquery.Client.projectID
.Reported initially on PR #10924
Supersedes #10924