Skip to content

Support for with statement for Client class #538

Closed
@nnaka2992

Description

@nnaka2992

Is your feature request related to a problem? Please describe.
Currently, the Client class does not support with statement. Supporting with statement would make programmers easy to write and maintenance their code.

Describe the solution you'd like
Add __enter__ and __exit__ methods to enable with statement. Works as following would be perfect.

with bigquery.Client(location='Asia/Tokyo') as client:
    query_job = client.query("SELECT CURRENT_DATE('Asia/Tokyo');")

Metadata

Metadata

Assignees

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