镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

bigquery dataset should not always take project argument from client #2118

Closed

Description

@elibixby

The project in which a dataset resides is not necessarily the project in which jobs involving the dataset will be executed. For example, if querying the bigquery public data hacker news dataset the following will error

client = bigquery.Client(project='bigquery-public-data')
dataset = client.dataset('hacker_news')
client.extract_table_storage(..., dataset.table('comments'))

Because the user can't create a job in the project 'bigquery-public-data'. Instead the fairly convoluted:

client = bigquery.Client(project='my-project')
client.extract_table_storage(..., bigquery.Client(project='bigquery-public-data').dataset('hacker_news').table('comments'))

Despite the fact that the client involved will never be used.

The proposed fix is to add a kwarg project to the Dataset class which overrides the originating project.

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    api: bigqueryIssues related to the BigQuery API.
    on Aug 18, 2016
  2. self-assigned this
    on Aug 18, 2016
  3. tseaver commented on Aug 18, 2016

    @tseaver
    Contributor

    @elibixby Thanks for the report!

  4. tswast commented on Aug 26, 2016

    @tswast
    Contributor

    +1 to this. I filed a similar issue in gcloud-java googleapis/google-cloud-java#1123 which does provide a project as part of the dataset identifier (but it doesn't always use it, yikes!)

  5. added a commit that references this issue on May 6, 2017
    6249e3f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions