-
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
feat(bigquery): expose ProjectID from Client & Job #4076
Conversation
@shollyman @codyoss Any chance this could make it into the 1.19 release? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This seems reasonable to expose. I've also created #4228 for myself to come back through and improve job reference construction.
Feedback from others was we should consider whether we should simply change to exported variables. Primary issue is still the retained context; need to take a closer look at this to see if we want to open it up rather than simply exposing functions as laid out here. |
For reference, ProjectID is exported in Dataset. I don't particularly care whether ProjectID is exported or whether it is exposed with a function to protect the integrity of the object. I just worry that taking a closer look will cause this to end up in the backlog. google-cloud-go/bigquery/dataset.go Lines 30 to 31 in 22344f0
|
PR supersedes: googleapis#4076 Related: googleapis#1294 With this change, project autodetection is enabled via use of a sentinel value, and the retained project identifier is now exposed on the Client and Job resources via the Project() function.
Closing this PR, functionality was added in #4312. Thanks for bringing it to my attention, ended up highlighting the autodetection gap. |
Thanks for making that happen, much appreciated |
As more and more BigQuery features like BI Engine, Reservations, etc. are opt-in at a project level only, we are now using more dependency injection for multiple clients. As currently written, we have to create a throwaway dataset from the client to expose the project associated with the client and keep track of that separately to map to any jobs. The project is trivially available from both the client and job, so this PR exposes both.