Skip to content

Commit

Permalink
resolve generation issue with reload and not soft_deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsg committed Oct 28, 2024
1 parent 9e96b82 commit 11b1351
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions google/cloud/storage/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ def reload(
)
if soft_deleted is not None:
query_params["softDeleted"] = soft_deleted
# Soft delete reload requires a generation, even for targets
# that don't include them in default query params (buckets).
query_params["generation"] = self.generation
headers = self._encryption_headers()
_add_etag_match_headers(
headers, if_etag_match=if_etag_match, if_etag_not_match=if_etag_not_match
Expand Down
2 changes: 0 additions & 2 deletions google/cloud/storage/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,6 @@ def hard_delete_time(self):
def _query_params(self):
"""Default query parameters."""
params = super()._query_params
if self.generation is not None:
params["generation"] = self.generation
return params

@classmethod
Expand Down

0 comments on commit 11b1351

Please sign in to comment.