add DateTimeUTC#68
Closed
Frosty2500 wants to merge 2 commits intoupdate/Metamodel_V3.1.2from
Closed
Conversation
s-heppner
reviewed
Dec 5, 2025
Comment on lines
+1315
to
+1318
| if ((last_update and last_update.tzinfo and | ||
| last_update.tzinfo.utcoffset(last_update) != timezone.utc.utcoffset(None)) | ||
| or (last_update and last_update.tzinfo is None)): | ||
| raise ValueError("Last update must be in UTC!") |
Member
There was a problem hiding this comment.
From a feeling, I'd say this check should be before the attribute self.last_update is written.
However, this whole thing seems a little hacky, maybe we should discuss this in our next meeting.
85944e3 to
10254b7
Compare
Member
|
Decision of the dev team:
|
Member
|
I tried to solve this and I decided we should leave it as it is currently implemented. The only place @last_update.setter
def last_update(self, last_update: Optional[datatypes.DateTime]) -> None:
if last_update is not None and last_update.tzname() != "UTC":
raise ValueError("last_update must be specified in UTC!")
self._last_update: Optional[datatypes.DateTime] = last_updateThis makes the check implemented here in the As long as the usage of events in the SDK are not fully specified, I'd keep it that way. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See here for the adaption of last_update, here for DateTimeUTC