Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

@tswast
Copy link
Contributor

…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:

  • Add default_project argument to DatasetReference.from_string
  • Add default_project argument to TableReference.from_string

Towards#6055. Not closes because we should add similar logic to thecreate_dataset andcreate_table methods, 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.

…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
@googlebotgooglebot added the cla: yesThis human has signed the Contributor License Agreement. labelOct 4, 2018

ifisinstance(destination,str):
destination=TableReference.from_string(
destination,default_project=self.project)

This comment was marked as spam.

This comment was marked as spam.

@max-sixty
Copy link

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.

Copy link
Contributor

@alixhamialixhami left a 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.

@tswast
Copy link
ContributorAuthor

@dpebot merge when green

@dpebot
Copy link
Contributor

Okay! I'll merge when all statuses are green and all reviewers approve.

@dpebotdpebot added the automergeMerge the pull request once unit tests and other checks pass. labelOct 4, 2018
@dpebotdpebot self-assigned thisOct 4, 2018
@tswasttswast merged commit93d5ea2 intogoogleapis:masterOct 4, 2018
@tswasttswast deleted the issue-6055-dataset-table-ref branchOctober 4, 2018 22:17
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alixhamialixhamialixhami approved these changes

+1 more reviewer

@max-sixtymax-sixtymax-sixty left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

@dpebotdpebot

Labels

automergeMerge the pull request once unit tests and other checks pass.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@tswast@max-sixty@dpebot@alixhami@googlebot

[8]ページ先頭

©2009-2025 Movatter.jp