GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feature request: better api for arbitrary keyword argument pass to query ? · Issue #3210 · googleapis/google-cloud-python

feature request: better api for arbitrary keyword argument pass to query ? #3210

New issue
Copy link
New issue
Copy link
Closed
Closed
feature request: better api for arbitrary keyword argument pass to query ?#3210
Copy link
Assignees
tswast
Labels
api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@c0b
c0b
opened on Mar 27, 2017
Issue body actions

from this example https://googlecloudplatform.github.io/google-cloud-python/stable/bigquery-usage.html#querying-data-asynchronous

>>> dataset = client.dataset('dataset_name')
>>> table = dataset.table(name='person_ages')
>>> job = client.run_async_query('fullname-age-query-job', query)
>>> job.destination = table
>>> job.write_disposition= 'WRITE_TRUNCATE'
>>> job.name
'fullname-age-query-job'
>>> job.job_type
'query'
>>> job.created
None
>>> job.state
None

how about a better api by allowing arbitrary keyword list to be appended on the insert job POST request
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs the keyword destinationTable and writeDisposition here are from rest api reference, this way can keep google-cloud-python library to be a thinner layer, just gives user the best flexibility

>>> job = client.run_async_query(query,
          destinationTable={'datasetId': 'dataset_name', 'tableId': 'person_ages'},
          writeDisposition='WRITE_TRUNCATE',
          )

in python it can be implemented as dict as last argument:

def run_async_query(query, **kwargs):
    # populate from kwargs to be on the `configuration.query` in the post request body,
    # it could optionally have jobId

Btw, from #3209 I am not puting a job_name / jobid field because I don't think that's necessary, the run_async_query shouldn't require user to provide a jobid, in the rest api insert job request, if jobid is absent, server side would generate a unique id

Activity

  1. daspecster
    added
    api: bigqueryIssues related to the BigQuery API.
    on Mar 27, 2017
  2. lukesneeringer
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Mar 28, 2017
  3. lukesneeringer commented on Mar 28, 2017

    @lukesneeringer
    lukesneeringer
    on Mar 28, 2017
    Contributor
    More actions

    Hi @c0b, thanks for reporting. We will evaluate this.

  4. lukesneeringer
    removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Aug 9, 2017
  5. tswast commented on Aug 11, 2017

    @tswast
    tswast
    on Aug 11, 2017
    Contributor
    More actions

    👍 on a way to provide job config directly.

    Closing this since I'm tracking this internally for GA redesign.

  6. tswast
    closed this as completedon Aug 11, 2017
  7. tswast commented on Aug 11, 2017

    @tswast
    tswast
    on Aug 11, 2017
    Contributor
    More actions

    Actually, reopening since this might not make it into the first iteration of the GA library.

    I think the most appropriate place for this while preserving existing behavior will be to add an argument to the .begin() method of the various job classes. Example:

    query_job = client.query(query_string)
    query_job.begin(config_overrides={
            'destinationTable': {
                'projectId': 'some-project',
                'datasetId': 'some-dataset',
                'tableId': 'some-table'
            }
    })
    

    Any properties that appear in the config_overrides dictionary will be merged into the API resource representation before calling the jobs insert HTTP method.

  8. tswast
    reopened this on Aug 11, 2017
  9. lukesneeringer commented on Aug 11, 2017

    @lukesneeringer
    lukesneeringer
    on Aug 11, 2017
    Contributor
    More actions

    @tswast Go ahead and track it in your doc in lieu of here, and just have a section in that doc for "things that might be post-GA".

  10. lukesneeringer
    closed this as completedon Aug 11, 2017
  11. JustinBeckwith
    assigned
    tswast
    on Feb 1, 2021
  12. parthea
    added 2 commits that reference this issue on Sep 22, 2023

    chore(deps): update dependency google-cloud-texttospeech to v1 [(#3210)…

    f011b67

    chore(deps): update dependency google-cloud-texttospeech to v1 [(#3210)…

    967428b
  13. parthea
    added 2 commits that reference this issue on Oct 21, 2023

    chore(deps): update dependency google-cloud-texttospeech to v1 [(#3210)…

    48e9562

    feat!: migrate API to microgenerator (#31)

    00a2690
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tswast
    tswast

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.