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 — BigQuery properties issues in query.py · Issue #3001 · googleapis/google-cloud-python

BigQuery properties issues in query.py #3001

New issue
Copy link
New issue
Copy link
Closed
Closed
BigQuery properties issues in query.py#3001
Copy link
Assignees
danoscarmike
Labels
api: bigqueryIssues related to the BigQuery API.backendpriority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@amirshavit
amirshavit
opened on Feb 13, 2017
Issue body actions

(1) When I run a long, non-cached, sync query --

query_job = bq_client.run_sync_query(query_string)
query_job.run()

... it often returns without being complete. I call query_job.fetch_data(page_token=None) to try and get the result. If the query finished by that time -- all is well, however if doesn't, the server response doesn't include the job's name (jobReference.jobId); since the state is being completely erased/rewritten, following calls to fetch_data fail with ValueError("Query not yet executed: call 'run()'").

(2) The run method checks if self._job is not None: to prevent a double invocation. It should however run that check with self.job instead (no underscore), as self._job is only set if you previously used self.job.

(3) It would be 'nicer' if the total_rows property return an integer (or None) rather than a string.

Activity

  1. daspecster
    added
    api: bigqueryIssues related to the BigQuery API.
    on Feb 13, 2017
  2. tseaver
    added
    backend
    on Feb 13, 2017
  3. tseaver commented on Feb 13, 2017

    @tseaver
    tseaver
    on Feb 13, 2017
    Contributor
    More actions

    @amirshavit Thanks for the report! I've set the back-end label because the API docs for jobs/getQueryResults say that the resource returned from that API must include the jobReference.jobId subkey.

    I've split out your second and third points into separate issues (#3002, #3003, #3004).

  4. danoscarmike
    added
    Status: Acknowledged
    on Feb 28, 2017
  5. bjwatson
    added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Feb 28, 2017
  6. bjwatson
    assigned
    lukesneeringer
    on Feb 28, 2017
  7. lukesneeringer commented on Feb 28, 2017

    @lukesneeringer
    lukesneeringer
    on Feb 28, 2017
    Contributor
    More actions

    I will reroute this to the BigQuery folks.

  8. lukesneeringer
    assigned
    danoscarmike
    and unassigned
    lukesneeringer
    on Feb 28, 2017
  9. tseaver commented on May 16, 2017

    @tseaver
    tseaver
    on May 16, 2017
    Contributor
    More actions

    /cc @tswast

  10. jcondit commented on Jun 5, 2017

    @jcondit
    jcondit
    on Jun 5, 2017
    More actions

    The OP is correct that these are issues in the design of the current library API. We're working on a revised version that will make the long-running query flow more convenient to execute.

  11. aschmolck commented on Jul 14, 2017

    @aschmolck
    aschmolck
    on Jul 14, 2017
    More actions

    What's the status of this? Does 0.26.x fix the problem?

  12. amirshavit commented on Aug 8, 2017

    @amirshavit
    amirshavit
    on Aug 8, 2017
    Author
    More actions

    Seems like it's not fixed; almost 6 months 😞

  13. tswast commented on Aug 8, 2017

    @tswast
    tswast
    on Aug 8, 2017
    Contributor
    More actions

    The redesign will not have a separate "sync" query versus "async" query. To get the behavior of what the query method will be, use the async query method. With the 0.26.0 release the QueryJob class follows the PEP 3148 Futures API.

        import uuid
        from google.cloud import bigquery
    
        client = bigquery.Client()
        query_job = client.run_async_query(str(uuid.uuid4()), query)
        query_job.begin()
    
        query_job.result()  # Wait for job to complete
        destination_table = query_job.destination
        destination_table.reload()
        for row in destination_table.fetch_data():
            print(row)
    
  14. lukesneeringer commented on Aug 11, 2017

    @lukesneeringer
    lukesneeringer
    on Aug 11, 2017
    Contributor
    More actions

    @tswast Closing this as your redesign supercedes it. Reopen if you disagree.

  15. lukesneeringer
    closed this as completedon Aug 11, 2017
  16. parthea
    added a commit that references this issue on Sep 22, 2023

    chore: move samples from python-docs-sample (#66)

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

Metadata

Metadata

Assignees

  • @danoscarmike
    danoscarmike

Labels

api: bigqueryIssues related to the BigQuery API.backendpriority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

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.