- Notifications
You must be signed in to change notification settings - Fork1.6k
Allow string in addition to DatasetReference / TableReference in Clie…#6164
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…nt methods.Whereever a client method accepts a DatasetReference or TableReference,it now also accepts a string. The project ID can be omitted from thestring and the Client's default project is used instead.Also, to make it easier to share code across client methods for creatingXReference classes:* Add default_project argument to DatasetReference.from_string* Add default_project argument to TableReference.from_string
| ifisinstance(destination,str): | ||
| destination=TableReference.from_string( | ||
| destination,default_project=self.project) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
max-sixty commentedOct 4, 2018
Thank you@tseaver ! I find thisfar more pythonic and easier to use (e.g. the proportion of instances I'll use the API without pulling up the docs is much higher). Interested what others think. |
alixhami left a comment
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.
Awesome!
| :type retry: :class:`google.api_core.retry.Retry` | ||
| :param retry: (Optional) How to retry the RPC. | ||
| Args: | ||
| dataset_ref (Union[ |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
tswast commentedOct 4, 2018
@dpebot merge when green |
dpebot commentedOct 4, 2018
Okay! I'll merge when all statuses are green and all reviewers approve. |
…nt methods.
Whereever a client method accepts a DatasetReference or TableReference,
it now also accepts a string. The project ID can be omitted from the
string and the Client's default project is used instead.
Also, to make it easier to share code across client methods for creating
XReference classes:
Towards#6055. Not closes because we should add similar logic to the
create_datasetandcreate_tablemethods, but they need to be modified to also accept a reference. My thought there is that we can create an empty table/dataset resource when a string or reference is passed in.@max-sixty Please take a look.