-
Notifications
You must be signed in to change notification settings - Fork 322
Closed
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Is your feature request related to a problem? Please describe.
I would like to store the job_id that references the job created after cursor.execute is called. Currently I do this:
job_id = dbapi_cursor._query_job.job_idDescribe the solution you'd like
I would prefer to do something like this:
# Returns the `QueryJob` created by the last `execute*()` call
job = dbapi_cursor.job()
job_id = job.job_idDescribe alternatives you've considered
It is possible to specify the job_id when calling cursor.execute, however:
- I don't call
cursor.executein my code (see additional context below) - I would prefer to use the generated ID
Additional context
I interact with this library from the BigQuery SQLAlchemy dialect, so I never call DBAPI execute directly:
sqlalchemy_cursor = engine.execute(...) # eventually calls `dbapi_cursor.execute`
dbapi_cursor = sqlalchemy_cursor.cursor
job_id = dbapi_cursor._query_job.job_idtswast
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.