You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BigQuery Python Client v0.28.0: Can't recover {Dataset,Table}References from Dataset or Table objects #4327
In v0.28.0 of the BigQuery Python Client, it doesn't seem possible to recover the original DatasetReference or TableReference used to create the the Dataset or Table, 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], a table_ref is expected; it seems logically unreasonable that a full Table object can't be used to fulfil the need for a table reference.
Activity
dhermes commentedon Nov 2, 2017
@tswast Can you lend a hand here?
tswast commentedon Nov 10, 2017
This is a good feature request. I agree that such a change would improve usability.
I see two ways to address this:
TableorTableReferencefor operations such asclient.load_table_from_file(). Likewise forDatasetandDatasetReference.TableReferencefrom aTableobject. Likewise forDatasetandDatasetReference.In the meantime, the workaround is to create a
TableReferencemanually from aTable.My preference would be for (2). Something like the following code:
robfraz commentedon Nov 13, 2017
@tswast Sounds good. You want me to submit a pull request, or is this something that you'll add yourselves?
tswast commentedon Nov 13, 2017
Contributions welcome. :-)
tswast commentedon Nov 17, 2017
I've got a PR pending #4405
robfraz commentedon Nov 20, 2017
Nice - thanks. I wouldn't have had a chance to get to it until the weekend just gone, and you beat me to it.