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

DBAPI - running a series of statements that depend on each other (DECLARE, SET, SELECT, ...) #377

Closed
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
@mistercrunch

Description

@mistercrunch

see original issue here:googleapis/python-bigquery-sqlalchemy#74

I'm a committer inApache Superset and we integrate generally fairly well with BigQuery using the DBAPI driver provided here. Using the python DBAPI driver for BigQuery, we're having an issue running a chain of statements that depend on each other in a common session. I'm using a simple connection and cursor behind the scene.

It appears that the statements are not chained and the session/connection isn't persisted. Any clue on how to solve this? All other DBAPI

Other DBAPI implementations allow this type of chaining, and using the same logic with this driver does not work properly.

Here's a simple script exemplifying this:

DECLARE dDATE DEFAULTCURRENT_DATE();CREATE TEMP FUNCTION Add(x INT64, y INT64)AS (x+ y);SELECT Add(3,4);

Environment details

  • OS type and version: Linux
  • Python version: 3.7.x
  • pip version:20.2.4
  • google-cloud-bigquery version:pip show google-cloud-bigquery 1.28.0

Steps to reproduce

code:

withclosing(engine.raw_connection())asconn:withclosing(conn.cursor())ascursor:cursor.execute("DECLARE d DATE DEFAULT CURRENT_DATE()")cursor.execute("CREATE TEMP FUNCTION Add(x INT64, y INT64) AS (x + y)")cursor.execute("SELECT Add(3, 4)")

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the googleapis/python-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


      [8]ページ先頭

      ©2009-2025 Movatter.jp