Skip to content

Conversation

@tseaver
Copy link
Contributor

@tseaver tseaver commented Aug 7, 2015

  • Add missing top-level convenience imports
  • Add missing Client.list_datasets and Dataset.list_tables methods.

@tseaver tseaver added the api: bigquery Issues related to the BigQuery API. label Aug 7, 2015
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 7, 2015

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Aug 8, 2015

Really easy to review! Thanks.

Only a few hangups, pubsub in docstrings, KeyError questions in factories and use of ? in a docstring.

@tseaver
Copy link
Contributor Author

tseaver commented Aug 10, 2015

@dhermes I think everything is resolved, except the question about KeyErrors for missing datasetReference / tableReference entries: my take is that we should go forward as is:

  • We have no evidence that the back-end fails to set those values.
  • Without them, we have no way to construct a Dataset / Table which could be used to make API requests (without a name), which means the KeyError is the earliest possible detection for the useless resource.

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Aug 10, 2015

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 KeyError: 'datasetReference' or KeyError: 'datasetId'.

@tseaver
Copy link
Contributor Author

tseaver commented Aug 10, 2015

FWIW, I'd generally prefer not to re-wrap exceptions (losing the original traceback really damages debuggability, for instance).

@dhermes
Copy link
Contributor

dhermes commented Aug 10, 2015

If we raise one line after the KeyError would have occurred, how does that damage debuggability? If the method fails and the user sees an error in a method they've never heard of, isn't that also pretty low quality debuggability?

@tseaver
Copy link
Contributor Author

tseaver commented Aug 10, 2015

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".

@dhermes
Copy link
Contributor

dhermes commented Aug 10, 2015

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 KeyError would on its own.

@tseaver
Copy link
Contributor Author

tseaver commented Aug 10, 2015

When a Python programmer sees a traceback for a KeyError where the bottommost line is:

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 resource and try to figure out why those keys are missing.

@dhermes
Copy link
Contributor

dhermes commented Aug 10, 2015

Yes that's the root of my original question.

Do we want that Python programmer to just see that KeyError and try to figure out what resource was and where it came from, or do we want to give them more information which will explain why the error occurred. I was leaning towards the latter since it is not a method users would ever invoke, hence their knowledge of the inputs and failure modes would be minimal.

@tseaver
Copy link
Contributor Author

tseaver commented Aug 10, 2015

@dhermes 34a747c adds a check such as you suggested.

@dhermes
Copy link
Contributor

dhermes commented Aug 10, 2015

LGTM

tseaver added a commit that referenced this pull request Aug 10, 2015
@tseaver tseaver merged commit 3357530 into googleapis:master Aug 10, 2015
@tseaver tseaver deleted the bigquery-flesh_out_api branch August 10, 2015 21:33
parthea pushed a commit that referenced this pull request Nov 24, 2025
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 24, 2025
* chore(deps): update all dependencies

* Update samples/snippets/requirements.txt

---------

Co-authored-by: Chalmer Lowe <chalmerlowe@google.com>
parthea pushed a commit that referenced this pull request Nov 26, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants