-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Flesh out bigquery API #1045
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
Flesh out bigquery API #1045
Conversation
gcloud/bigquery/dataset.py
Outdated
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Really easy to review! Thanks. Only a few hangups, |
Addresses: https://github.com/GoogleCloudPlatform/gcloud-python/pull/1045/files#r36571762 https://github.com/GoogleCloudPlatform/gcloud-python/pull/1045/files#r36571777 https://github.com/GoogleCloudPlatform/gcloud-python/pull/1045/files#r36571768 https://github.com/GoogleCloudPlatform/gcloud-python/pull/1045/files#r36571771
|
@dhermes I think everything is resolved, except the question about
|
gcloud/bigquery/client.py
Outdated
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
I agree that we can be mostly secure in the belief that the backend will send good data and that without those keys, we can't do anything anyhow. I just wanted to discuss the possibility that we would provide a more specific error message than |
Addresses: #1045 (comment) #1045 (comment)
Addresses: #1045 (comment)
|
FWIW, I'd generally prefer not to re-wrap exceptions (losing the original traceback really damages debuggability, for instance). |
|
If we raise one line after the |
|
Hiding the key error is the harm I'm talking about: the user won't be better able to debug some other error more easily than "that key isn't in the resource as expected". |
|
Maybe we are thinking of different things. This is what I have in mind: if ('datasetReference' not in resource or
'datasetId' not in resource['datasetReference']):
raise KeyError('The resource returned from the server did not contain '
'the the necessary information to create a Dataset '
'object. The resource needs to contain a dictionary value '
'at the datasetReference key and within that dictionary '
'needs the datasetId.')
name = resource['datasetReference']['datasetId']What harm does this cause? I'm just suggesting we provide more information than what a |
|
When a Python programmer sees a traceback for a name = resource['datasetReference']['datasetId']doesn't she already know the same information you typed into that waaay-long error message? If debugging it, she will still dump out the contents of |
|
Yes that's the root of my original question. Do we want that Python programmer to just see that |
|
LGTM |
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
* chore(deps): update all dependencies * Update samples/snippets/requirements.txt --------- Co-authored-by: Chalmer Lowe <chalmerlowe@google.com>
* feat: Add Pluggable auth support See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md feat: Add Pluggable auth support (#988) * Port identity pool credentials * access_token retrieved * -> pluggable * Update pluggable.py * Create test_pluggable.py * Unit tests * Address pr issues feat: Add file caching (#990) * Add file cache * feat: add output file cache support 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Update pluggable.py 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Update pluggable.py Update setup.py 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Update setup.py Update setup.py pytest_subprocess timeout Update pluggable.py env 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Update _default.py 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Update requirements.txt Update _default.py Update pluggable.py Update pluggable.py Update pluggable.py Update test_pluggable.py format validations Update _default.py Update requirements.txt 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Revert "Update requirements.txt" This reverts commit 1c9b6db25c683663ed4b71ab0ab39946fce8f6eb. Revert "Update _default.py" This reverts commit ac6c36072084a440c234a9465b35462bd52378b3. Revert "Revert "Update _default.py"" This reverts commit 1c08483586007e4caf1a36f2c9cbf2a45d403ee0. Raise output format error but retry parsing token if `success` is 0 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Update requirements.txt Delete test_pluggable.py Revert "Delete test_pluggable.py" This reverts commit 74beba9405564a5b764af8718c49e640d9b84c5f. Update pluggable.py Update pluggable.py pytest-subprocess 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md lint Update pluggable.py nox cover nox cover 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md lint Update test_pluggable.py Update test_pluggable.py * Disable Pluggable Auth for Python 2.* Update noxfile.py * Update pluggable.py * Update pluggable.py * Update pluggable.py * Update pluggable.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Address PR issues * Update pluggable.py * Update pluggable.py * Update user-guide.rst * Update user-guide.rst * Update user-guide.rst * Update user-guide.rst * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Co-authored-by: Leo <39062083+lsirac@users.noreply.github.com>
Client.list_datasetsandDataset.list_tablesmethods.