Skip to content

Storage: include generation in Blob repr. #7789

Closed

Description

@max-sixty

I added a comment here based on the generation addition to storage #7444 (comment)

I think it's worth adding an issue too - specifically because now generation defines a blob but isn't included in the repr. Meaning you can get confusing results like this:

blob
<Blob: sixty-capital-temp, tests/test_357256/blob_645776>

b2 = gcs.client(project).get_bucket(bucket).get_blob(blob.name)  # recreate 
b2
<Blob: sixty-capital-temp, tests/test_357256/blob_645776>  # same repr

blob.exists()
False

b2.exists()
True

... but b2 & blob have the same repr! Prior to the latest release, both results would have been True.
If generation were in the repr, this would be less confusing - e.g. I wouldn't have had to read the release notes to work out what was going on

Activity

  1. added
    api: storage
    type: feature request
    on Apr 23, 2019
  2. changed the title [-]Storage: Blobs with same repr can be different[/-] [+]Storage: include generation in Blob repr.[/+] on Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: storagetype: feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions