-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for 'Blob.custom_time' and lifecycle rules #199
Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c03d6ae
feat(storage): add support of custom time metadata and timestamp
HemangChothani 7347cf2
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani ef32ca2
Merge branch 'master' into storage_issue_196
jkwlui 0212ca4
feat(storage): change the return type of custom_time_before
HemangChothani a6c830c
feat(storage): add setter method
HemangChothani 3dbda6a
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani 04e3a10
Merge branch 'master' into storage_issue_196
tseaver 75e6067
feat(storage): add test for None value
HemangChothani 7ee2796
Merge branch 'storage_issue_196' of https://github.com/q-logic/python…
HemangChothani e2793ce
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani 43f1f5a
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani 0bd9bf4
feat(storage): changes in unittest
HemangChothani fee993f
feat(storage): change custom_time type to date
HemangChothani 76457b1
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani ae71f29
feat: change custom_time to datetime
HemangChothani d99fcb9
Merge branch 'master' of https://github.com/googleapis/python-storage…
HemangChothani 62781a3
Merge branch 'master' into storage_issue_196
frankyn 0fcf160
Merge branch 'master' into storage_issue_196
frankyn 39a12f0
feat: nit
HemangChothani 285e15b
Merge branch 'storage_issue_196' of https://github.com/q-logic/python…
HemangChothani 780a616
feat: resolve conflict and nit
HemangChothani e76b8bb
Merge branch 'master' into storage_issue_196
frankyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3196,11 +3196,14 @@ def custom_time(self, value): | |
|
||
See https://cloud.google.com/storage/docs/json_api/v1/objects | ||
|
||
:type value: :class:`datetime.datetime` | ||
:type value: :class:`datetime.datetime` or ``NoneType`` | ||
:param value: (Optional) Set the custom time of blob. Datetime object parsed | ||
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 |
||
from RFC3339 valid timestamp. | ||
""" | ||
self._properties["customTime"] = _datetime_to_rfc3339(value) | ||
if value is not None: | ||
value = _datetime_to_rfc3339(value) | ||
|
||
self._properties["customTime"] = value | ||
|
||
|
||
def _get_encryption_headers(key, source=False): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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.
There was a problem hiding this comment.
Choose a reason for 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.