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

BigQuery: Potentially more Pythonic options for the API? #6055

Closed
Assignees
tswast
Labels
api: bigqueryIssues related to the BigQuery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
@max-sixty

Description

@max-sixty

Ithought I'd discussed this with@tswast, and he'd even generously added a PR; but after ten mins of searching GH I've come up empty on both issues and PRs, so posting here.
@tswast lmk if my memory is correct and we have discussed this!

I appreciate API design is difficult and there are tradeoffs between verbosity vs explicitness, and consistency within a product vs language-specific adjustments. The bar should be high for people offering criticism when they can only see a subset of the relevant information.
But I do frequently use the BQ python API and find it fairly awkward and un-pythonic, as though I were writing Java.

Here's an example, straight from the docs:

from google.cloud import bigqueryclient = bigquery.Client()dataset_id = 'my_dataset'  # replace with your dataset IDtable_id = 'my_table'  # replace with your table IDtable_ref = client.dataset(dataset_id).table(table_id)table = client.get_table(table_ref)  # API request

I would love to be able to write this, and receive a table object.

client = bigquery.Client()client.table(dataset='ds', table='tbl')

There are some points a level down (the.table object doesn't return aTable object while a dataset object does return aDataset object / do we need aTableReference class in place of a string, etc), but they all center around the ergonomics of the API, particularly in respect to Python.

Thank you as ever for a wonderful product, and appreciate any thoughts on whether I'm making mistakes here.

Metadata

Metadata

Assignees

Labels

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