Skip to content

Storage: include generation in Blob repr. #7789

@max-sixty

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

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions