GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: add support for 'Blob.custom_time' and lifecycle rules by HemangChothani · Pull Request #199 · googleapis/python-storage
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
Conversation
Contributor
Fixes #196
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
jkwlui
approved these changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @HemangChothani! Please hold until product is ready to move forward.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
tseaver
suggested changes
Uh oh!
There was an error while loading. Please reload this page. …into storage_issue_196
Contributor
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
tseaver
previously requested changes
Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document the semantics of
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…-storage into storage_issue_196 …into storage_issue_196 Y
tseaver
reviewed
Uh oh!
There was an error while loading. Please reload this page.
MaxxleLLC
force-pushed
the
storage_issue_196
branch
from
1d96369 to
0bd9bf4
Compare
frankyn
suggested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your patience @HemangChothani, Update: The Cloud Storage team has updated type of noncurrent_time_before and custom_time to be a Date format (YYYY-mm-dd) instead of DateTime. Discovery document with updated documentation with respect to these fields:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. …into storage_issue_196
frankyn
suggested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be dateTime
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
frankyn
suggested changes
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have two nits for documentation, otherwise LGTM.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once set it can't be unset and only changed to a custom datetime in the future. If the custom_time must be unset, you must either perform a rewrite operation or upload the data again.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd state that setter can only be datetime.datetime to not confuse folks.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
|
|
||
| See https://cloud.google.com/storage/docs/json_api/v1/objects | ||
|
|
||
| :type value: :class:`datetime.datetime` or ``NoneType`` |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd state that setter can only be datetime.datetime to not confuse folks.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
tseaver's feedback was addressed and dismissing as the PR LGTM.
|
|
||
| @custom_time.setter | ||
| def custom_time(self, value): | ||
| """Set the custom time for the object. Once set it can't be unset |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please follow PEP 257 for Multi-line docstrings, i.e., move the non-summary down below.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| """Set the custom time for the object. Once set it can't be unset | ||
| and only changed to a custom datetime in the future. If the | ||
| custom_time must be unset, you must either perform a rewrite operation | ||
| or upload the data again. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
These semantics are not enforced by the method.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @property | ||
| def days_since_custom_time(self): | ||
| """Conditon's 'days_since_custom_time' value.""" | ||
| return self.get("daysSinceCustomTime") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Setter for this property?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| """Conditon's 'custom_time_before' value.""" | ||
| before = self.get("customTimeBefore") | ||
| if before is not None: | ||
| return datetime_helpers.from_iso8601_date(before) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Setter for this property?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the setter method for all this properties, because we don't have a method for other properties as well which defined before. Please let me know if needed, so need to create setter method for all the properties of LifecycleRuleConditions class.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks both, looks like setters weren't defined at this level. It will be filed as a feature request for now. It doesn't block customers from using the feature.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…pis#199) * feat(storage): add support of custom time metadata and timestamp * feat(storage): change the return type of custom_time_before * feat(storage): add setter method * feat(storage): add test for None value * feat(storage): changes in unittest * feat(storage): change custom_time type to date * feat: change custom_time to datetime * feat: nit Co-authored-by: Jonathan Lui <[email protected]> Co-authored-by: Tres Seaver <[email protected]> Co-authored-by: Frank Natividad <[email protected]>
…pis#199) * feat(storage): add support of custom time metadata and timestamp * feat(storage): change the return type of custom_time_before * feat(storage): add setter method * feat(storage): add test for None value * feat(storage): changes in unittest * feat(storage): change custom_time type to date * feat: change custom_time to datetime * feat: nit Co-authored-by: Jonathan Lui <[email protected]> Co-authored-by: Tres Seaver <[email protected]> Co-authored-by: Frank Natividad <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Support customTime metadata and custom timestamp based OLM
There was an error while loading. Please reload this page.