You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Storage: assigning 'Bucket.retention_policy' to None fails in systests #6368
api: storageIssues related to the Cloud Storage API.backendpriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
I think it changed based on it no longer accepts None when a Retention policy is defined. It used to accept it. I will follow-up on such subtle changes in the backend.
@retention_period.setterdefretention_period(self, value):
"""Set the retention period for items in the bucket. :type value: int :param value: number of seconds to retain items after upload or release from event-based lock. :raises ValueError: if the bucket's retention policy is locked. """policy=self._properties.setdefault('retentionPolicy', {})
ifvalueisnotNone:
policy['retentionPeriod'] =str(value)
else:
policy=Noneself._patch_property('retentionPolicy', policy)
Short update: turns out it was a bug in the feature that has since been fixed. The client shouldn't have depended on this route in the first place. I missed this during the review.
api: storageIssues related to the Cloud Storage API.backendpriority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
frankyn commentedon Nov 2, 2018
This is strange, I'm researching, from a brief inspection it is as if it no longer accepts the
Nonevalue in Python.frankyn commentedon Nov 2, 2018
I think it changed based on it no longer accepts
Nonewhen a Retention policy is defined. It used to accept it. I will follow-up on such subtle changes in the backend.As for the fix, I missed this during the review, because I have learned more!
From https://github.com/googleapis/google-cloud-python/blob/master/storage/google/cloud/storage/bucket.py#L1348-L1352
Change to:
frankyn commentedon Nov 2, 2018
Internal tracking bug: 115765214
Accomodate new back-end restriction on retention period. (#6388)
frankyn commentedon Nov 5, 2018
Short update: turns out it was a bug in the feature that has since been fixed. The client shouldn't have depended on this route in the first place. I missed this during the review.
Thanks @tseaver for the fast fix!
Accomodate new back-end restriction on retention period. (#6388)