Skip to content

In storage.Key.connection, determine appropriate behavior (null return vs. throwing error) #147

Closed

Description

@dhermes

From TODO: "If a bucket isn't defined, this is basically useless. Where do we throw an error?"

See gcloud.storage.Key.connection for relevant code and #146 for some context.

Activity

  1. dhermes commented on Sep 22, 2014

    @dhermes
    ContributorAuthor

    git blame output:

    13b5479c (JJ Geewax   2014-02-27 13:40:39 -0500  75)     # TODO: If a bucket isn't defined, this is basically useless.
    
  2. tseaver commented on Sep 23, 2014

    @tseaver
    Contributor

    Docstring mandates a return of None.

  3. dhermes commented on Sep 23, 2014

    @dhermes
    ContributorAuthor

    I think @jgeewax was suggesting an error might be more useful than the null value that the docstring describes.

  4. added this to the milestone on Sep 24, 2014
  5. tseaver commented on Oct 28, 2014

    @tseaver
    Contributor

    @jgeewax @dhermes Given that we allow construction of Keys with bucket=None, read-only access to the connection returning None in that case seems better than an exception: anybody trying use it without checking for None will get an immediate AttributeError for whatever method.

  6. dhermes commented on Oct 28, 2014

    @dhermes
    ContributorAuthor

    SGTM

    I have no strong feelings on this. I just filed it to get the TODO out of the code as part of #146 and move the discussion here.

  7. tseaver commented on Oct 31, 2014

    @tseaver
    Contributor

    @silvolu I recommend closing this issue.

  8. modified the milestones: , Storage Stable on Jan 30, 2015
  9. 101 remaining items

  10. added a commit that references this issue on Mar 2, 2026
  11. added a commit that references this issue on Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions