-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
BigQuery Python Client v0.28.0: Can't recover {Dataset,Table}References from Dataset or Table objects #4327
Comments
@tswast Can you lend a hand here? |
This is a good feature request. I agree that such a change would improve usability. I see two ways to address this:
In the meantime, the workaround is to create a
My preference would be for (2). Something like the following code:
|
@tswast Sounds good. You want me to submit a pull request, or is this something that you'll add yourselves? |
Contributions welcome. :-) |
I've got a PR pending #4405 |
Nice - thanks. I wouldn't have had a chance to get to it until the weekend just gone, and you beat me to it. |
Hello,
In v0.28.0 of the BigQuery Python Client, it doesn't seem possible to recover the original
DatasetReference
orTableReference
used to create the theDataset
orTable
, thus preventing any part of the API (or a user's application) that requires a reference to also take the Dataset or Table object. It seems the reference used in creating the Dataset or Table is lost on object creation [1][2].For example, in the
client.load_table_from_file()
function [3], atable_ref
is expected; it seems logically unreasonable that a full Table object can't be used to fulfil the need for a table reference.Cheers,
Rob
[1] https://github.com/GoogleCloudPlatform/google-cloud-python/blob/0.28.0/bigquery/google/cloud/bigquery/table.py#L170-L177
[2] https://github.com/GoogleCloudPlatform/google-cloud-python/blob/0.28.0/bigquery/google/cloud/bigquery/dataset.py#L204-L208
[3] https://github.com/GoogleCloudPlatform/google-cloud-python/blob/0.28.0/bigquery/google/cloud/bigquery/client.py#L692-L706
The text was updated successfully, but these errors were encountered: