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 — Consider allowing storage.bucket.Bucket.delete_key to silently fail if user requests it · Issue #160 · googleapis/google-cloud-python

Consider allowing storage.bucket.Bucket.delete_key to silently fail if user requests it #160

New issue
Copy link
New issue
Copy link
Closed
#328
Closed
Consider allowing storage.bucket.Bucket.delete_key to silently fail if user requests it#160
#328
Copy link
Assignees
tseaver
Labels
🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.
Milestone
Storage Stable

Description

@dhermes
dhermes
opened on Sep 22, 2014
Issue body actions

From TODO:

    # TODO: Should we accept a 'silent' param here to not raise an exception?

See storage.bucket.Bucket.delete_key for relevant code and #146 for some context.

git blame output

b7f1b774 (JJ Geewax   2014-01-29 18:02:29 -0500 158)     # TODO: Should we accept a 'silent' param here to not raise an exception?

Activity

Next
  1. tseaver
    added
    api: storageIssues related to the Cloud Storage API.
    on Sep 22, 2014
  2. tseaver commented on Sep 23, 2014

    @tseaver
    tseaver
    on Sep 23, 2014
    Contributor
    More actions

    -1: users who want to silence the exception can use 'try: ... except Blah: pass'

  3. dhermes commented on Sep 23, 2014

    @dhermes
    dhermes
    on Sep 23, 2014
    ContributorAuthor
    More actions

    I tend to agree with you but will play devil's advocate anyhow.

    I think JJ was targeting the case that DELETE is sent for an object that doesn't exist. I'd imagine in parallel code this could cause an issue if two deletes are sent.

    From an App Engine remote API session using the datastore:

    >>> from google.appengine.ext import ndb
    >>> k = ndb.Key('A', 'b')
    >>> print k
    Key('A', 'b')
    >>> print k.get()
    None
    >>> print k.delete()
    None
  4. silvolu
    added this to the This milestone has been deleted milestone on Sep 24, 2014
  5. tseaver commented on Oct 29, 2014

    @tseaver
    tseaver
    on Oct 29, 2014
    Contributor
    More actions

    The API spec doesn't state it, but I assume that it returns a 404 in the case that the key maps to a non-existent object. I still think propagating the storage.exceptions.NotFoundError raised by storage.connection.Connection.api_request is the more Pythonic thing to do.

  6. tseaver commented on Oct 29, 2014

    @tseaver
    tseaver
    on Oct 29, 2014
    Contributor
    More actions

    If #312 lands, it could be the resolution for this issue as well: users who want to delete without raising could use bucket.delete_keys([key]) instead of bucket.delete_key(key), and potentially check the result.

  7. tseaver commented on Oct 31, 2014

    @tseaver
    tseaver
    on Oct 31, 2014
    Contributor
    More actions

    @silvolu I would recommend closing here: users who don't care about the NotFoundError can call bucket.delete_keys([key]) omitting the on_error callback added in #312.

  8. silvolu commented on Nov 3, 2014

    @silvolu
    silvolu
    on Nov 3, 2014
    Contributor
    More actions

    Sounds good, should we add something to the docs for delete_keys to make it clear, e.g.: "You can use this method with a single key if you want to suppress any NotFoundError, by omitting the on_error callback" ?

  9. tseaver commented on Nov 3, 2014

    @tseaver
    tseaver
    on Nov 3, 2014
    Contributor
    More actions

    Actually, it would need to be different, since omitting the callback (now) causes the error to be raised. To suppress the error, you would need to call bucket.delete_keys([key], on_error=lambda key: pass).

  10. silvolu commented on Nov 3, 2014

    @silvolu
    silvolu
    on Nov 3, 2014
    Contributor
    More actions

    Oh, ok. Should we add that to the doc? Might be not immediately clear.

  11. tseaver
    closed this as completedin #328on Nov 3, 2014
  12. tseaver
    added a commit that references this issue on Nov 3, 2014

    Merge pull request #328 from tseaver/160-doc_avoid_notfound_when_del_key

    This issue will close once commit 2b73c7b is merged into the 'main' branch.
    2b73c7b
  13. jgeewax
    modified the milestones: Storage Stable, This milestone has been deleted on Jan 30, 2015
  14. yoshi-automation
    added
    triage meI really want to be triaged.
    on Apr 7, 2020
  15. 94 remaining items

  16. parthea
    added 6 commits that reference this issue on Nov 24, 2025

    chore: update doc links from googleapis.dev to cloud.google.com (#160)

    a83cadb

    chore: fix synth replacment for index creation (#166)

    6ac332b

    chore: add prerelease nox session (#160)

    ad99cb6

    fix: Add handling for documents missing all layout elements. (#161)

    fbb57e9

    chore: require CODEOWNER review and up to date branches (#160)

    0897d1d

    fix: django content length extraction bug (#160)

    dafd94d
  17. parthea
    added 3 commits that reference this issue on Mar 2, 2026

    chore(deps): update dependency wheel to v0.38.4 (#160)

    88dc180

    chore(deps): pin 'google-crc32c < 0.2dev' (#160)

    8f69d14

    feat: add _async_resumable_media experimental support (#179)

    cd7ed06
  18. parthea
    added 5 commits that reference this issue on Mar 9, 2026

    fix: calculate limit value correctly for offset only queries (#160)

    d54b7f3

    chore: release 1.0.0 (#167)

    9f78c53

    feat: DB-API driver + unit tests (#160)

    2e6f8f3

    chore: release 2.0.0 (#163)

    9362bba

    chore(deps): update dependency sphinx to v4.3.1 (#160)

    54342c2
  19. ohmayr
    added a commit that references this issue on Mar 31, 2026

    chore(deps): update dependency wheel to v0.38.4 (#160)

    3521380
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    • Storage Stable

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.