Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Linchin
Copy link
Contributor

@Linchin Linchin commented Feb 27, 2025

TODO: need to add tests

Example:

import sqlalchemy
from sqlalchemy import text
from google.cloud import bigquery

job_config_kwargs = {}
job_config_kwargs["use_query_cache"] = False
job_config = bigquery.QueryJobConfig(**job_config_kwargs)

bq_engine = sqlalchemy.create_engine(url="bigquery://")

with bq_engine.connect() as conn:
    res = conn.execute(text("SELECT 'a' AS `1`"), execution_options={"job_config": job_config})
    for item in res:
        print(item)

Fixes #1112 🦕

@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. labels Feb 27, 2025
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Mar 7, 2025
@Linchin Linchin marked this pull request as ready for review March 7, 2025 22:27
@Linchin Linchin requested review from a team as code owners March 7, 2025 22:27
@Linchin Linchin requested a review from alvarowolfx March 7, 2025 22:27
@Linchin Linchin requested review from chalmerlowe and removed request for alvarowolfx March 7, 2025 23:05
@chalmerlowe chalmerlowe changed the title feat: support job_cofig at query level feat: support job_config at query level Mar 10, 2025
Copy link
Collaborator

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Linchin Linchin enabled auto-merge (squash) March 10, 2025 17:49
@Linchin Linchin added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 10, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 10, 2025
@Linchin Linchin merged commit ea849e0 into googleapis:main Mar 10, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow a use_query_cache override directly in create_engine or execution_options
2 participants