GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Making all Blob/Bucket getters fail gracefully if keys don't exist. by dhermes · Pull Request #793 · googleapis/google-cloud-python

Conversation

@dhermes

@dhermes dhermes commented Apr 1, 2015

Copy link
Copy Markdown
Contributor

Also replacing uses of dict.copy() (shallow) with copy.deepcopy().

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 1, 2015
@dhermes dhermes added the api: storage Issues related to the Cloud Storage API. label Apr 1, 2015
@coveralls

coveralls commented Apr 1, 2015

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 873ec53 on dhermes:prevent-property-key-error-in-storage into 3af46b1 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tseaver
tseaver reviewed Apr 1, 2015
View reviewed changes
Comment thread gcloud/exceptions.py

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented Apr 1, 2015

Copy link
Copy Markdown
Contributor

ISTM that returning None from the getters breaks their contract a bit: we could either change the :rtype: to append or None, or else return defaults which match the documented type.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented Apr 1, 2015

Copy link
Copy Markdown
Contributor Author

@tseaver I imagine a future where people use their own projection or fields, e.g.

blob.reload(fields=['generation', 'metageneration'])

and then all other values are unset.

I think changing the rtype is the right way to go here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes
Making all Blob/Bucket getters fail gracefully if keys don't exist.
2971484
Also
- replacing uses of dict.copy() (shallow) with copy.deepcopy().
- Making getters honor contracts (e.g. return an integer if supposed to).
  This is necessary because int64 -> JSON becomes a string, even though
  we want an integer. This is due to only one numeric type "number" in
  JavaScript.
@dhermes
dhermes force-pushed the prevent-property-key-error-in-storage branch from 873ec53 to 2971484 Compare April 2, 2015 03:21
@dhermes

dhermes commented Apr 2, 2015

Copy link
Copy Markdown
Contributor Author

@tseaver I updated the docstrings and pushed again. I also coerced some values to ints, since int64 in JSON is a string even though it should be an int (due to JS precision problems).

I also wanted to convert the timestamps to datetime.datetime but was worried that using

datetime.datetime.strptime(value, '%Y-%m-%dT%H:%M:%S.%fZ')

would be insufficient for values returned by the backend (AFAIK the only contract is that they will be valid RFC3339).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented Apr 2, 2015

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 2971484 on dhermes:prevent-property-key-error-in-storage into fd06f16 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tseaver
tseaver reviewed Apr 3, 2015
View reviewed changes
Comment thread gcloud/storage/blob.py

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented Apr 3, 2015

Copy link
Copy Markdown
Contributor

Aside from the worry about PATCH w/ None, LGTM.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented Apr 3, 2015

Copy link
Copy Markdown
Contributor Author

PATCH with None effectively "unsets" the property. But we would only send None if it was explicitly set by the user.

I'm AFK now but would like to test out what happens if None is sent for a required property.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented Apr 6, 2015

Copy link
Copy Markdown
Contributor Author

@tseaver What is the implication of my answer? How to move forward?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented Apr 6, 2015

Copy link
Copy Markdown
Contributor

We should figure out what happens when {'metadata': null} is the payload for a PATCH request where metadata had already been set. If the back-end barfs, we shouldn't allow None as a value in the setter.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented Apr 6, 2015

Copy link
Copy Markdown
Contributor Author

@tseaver I was already pretty sure what happened, but I verified via https://developers.google.com/apis-explorer/#p/storage/v1/storage.objects.patch by sending "metadata: null" after previously setting metadata to {'foo': 'bar'}. It did as expected: it simply "unset" the metadata value.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented Apr 6, 2015

Copy link
Copy Markdown
Contributor

OK. ISTM we can just mirror that, then (the json module already marshalls Python None as null).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented Apr 6, 2015

Copy link
Copy Markdown
Contributor Author

Yep, we get it for free. Remaining hangups?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented Apr 6, 2015

Copy link
Copy Markdown
Contributor

Nope.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dhermes added a commit that referenced this pull request Apr 6, 2015
@dhermes
Merge pull request #793 from dhermes/prevent-property-key-error-in-st…
1536f09
…orage

Making all Blob/Bucket getters fail gracefully if keys don't exist.
@dhermes
dhermes merged commit 1536f09 into googleapis:master Apr 6, 2015
@dhermes
dhermes deleted the prevent-property-key-error-in-storage branch April 6, 2015 17:25
This was referenced Apr 8, 2015
Returning native datetime objects for Bucket/Blob time properties. #807
Merged
Upgrading version to 0.5.0. #813
Merged
parthea added a commit that referenced this pull request Sep 18, 2025
@gcf-owl-bot @Linchin @parthea
chore(python): use python 3.10 for docs build (#793)
0f782a3
* chore(python): use python 3.10 for docs build

Source-Link: googleapis/synthtool@9ae0785
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:52210e0e0559f5ea8c52be148b33504022e1faef4e95fbe4b32d68022af2fa7e

* use python 3.10 for docs build

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Lingqing Gan <[email protected]>
Co-authored-by: Anthonios Partheniou <[email protected]>
parthea pushed a commit that referenced this pull request Nov 22, 2025
@gcf-owl-bot
build(deps): bump cryptography from 39.0.1 to 41.0.0 in /synthtool/gc…
50d2ab3
…p/templates/python_library/.kokoro (#793)

Source-Link: googleapis/synthtool@d0f51a0
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:240b5bcc2bafd450912d2da2be15e62bc6de2cf839823ae4bf94d4f392b451dc

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 24, 2025
@release-please
chore: release 0.40.12 (#793)
9099da0
🤖 I have created a release \*beep\* \*boop\* 
---
### [0.40.12](https://www.github.com/googleapis/gapic-generator-python/compare/v0.40.11...v0.40.12) (2021-02-26)


### Bug Fixes

* exclude 'input' from reserved names list ([#788](https://www.github.com/googleapis/gapic-generator-python/issues/788)) ([da2ff71](https://www.github.com/googleapis/gapic-generator-python/commit/da2ff717b82357359baeeafad9a3e48a70e194cb))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
parthea added a commit that referenced this pull request Nov 24, 2025
@daniel-sanche @gcf-owl-bot @parthea
feat: support dynamic retry backoff values (#793)
d341f82
* feat: retry generates backoff value after completing on_error callbacks

* added comment

* use single sleep iterator for retries

* fix tests

* update variable name

* adjusted docstring

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fixed mypy issues

* added comment

* added unit tests for dynamic backoff

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
parthea pushed a commit that referenced this pull request Nov 24, 2025
@renovate-bot
chore(deps): update dependency google-cloud-logging to v3.8.0 (#793)
db63b45
parthea pushed a commit that referenced this pull request Nov 25, 2025
@renovate-bot
chore(deps): update dependency google-cloud-logging to v3.8.0 (#793)
c14ce69
parthea pushed a commit that referenced this pull request Nov 26, 2025
@bojeil-google
feat: define CredentialAccessBoundary classes (#793)
f479c65
Defines the following classes:
- `google.auth.downscoped.CredentialAccessBoundary`
- `google.auth.downscoped.AccessBoundaryRule`
- `google.auth.downscoped.AvailabilityCondition`

This is based on
[Downscoping with Credential Access Boundaries](https://cloud.google.com/iam/docs/downscoping-short-lived-credentials).
These classes help define the list of access boundary rules,
each of which contains information on the resource that the rule
applies to, the upper bound of the permissions that are available
on that resource and an optional condition to further restrict
permissions.
parthea pushed a commit that referenced this pull request Mar 2, 2026
@renovate-bot
chore(deps): update dependency google-cloud-bigquery to v3.3.3 (#793)
81e62d6
parthea pushed a commit that referenced this pull request Mar 6, 2026
@gcf-owl-bot
chore(python): update .kokoro/requirements.txt (#793)
914e3f8
Source-Link: googleapis/synthtool@703554a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:94961fdc5c9ca6d13530a6a414a49d2f607203168215d074cdb0a1df9ec31c0b
parthea pushed a commit that referenced this pull request Mar 9, 2026
@gcf-owl-bot
chore(python): exclude grpcio==1.49.0rc1 in tests (#793)
c5dd331
Source-Link: googleapis/synthtool@c4dd595
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ce3c1686bc81145c81dd269bd12c4025c6b275b22d14641358827334fddb1d72

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@dhermes @coveralls @tseaver @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.