-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BigQuery: Potentially more Pythonic options for the API? #6055
Comments
In our previous conversation, I added a You're right that the BigQuery client does still feel overly verbose. I find it a problem that The reason we have the It's a historical artifact that An idea:
PRs welcome! |
Hi Tim! Thanks for your thoughtful reply, as ever! I had the sense there might be some influence from the REST design.
That makes a lot of sense. Particularly if this could be I'm trying to focus on xarray & pandas-gbq re OSS work (and a touch of rust!) so while I'd love to tinker here, please don't wait for me on this one. I hope the comments are still productive even from the peanut gallery. |
Why not a step further and introducing |
@yiga2 I like the idea of a default dataset in principle, but there are so many places where a dataset might creep in that I fear it'd be hard to catch all uses, especially as the BigQuery API evolves and there may be new APIs that take datasets in their requests. Instead, we are starting to offer a slightly lower-level API where default resources can be provided. See: #6088 |
I thought 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:
I would love to be able to write this, and receive a table object.
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.
The text was updated successfully, but these errors were encountered: