-
Notifications
You must be signed in to change notification settings - Fork 18
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
chore: unify the event time of messages to drop #115
Conversation
Set the event time of messages to drop to 1969-12-31 00:00:00 +0000 UTC across all our SDKs. Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #115 +/- ##
=======================================
Coverage 94.84% 94.85%
=======================================
Files 29 29
Lines 1086 1088 +2
Branches 71 71
=======================================
+ Hits 1030 1032 +2
Misses 32 32
Partials 24 24
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
""" | ||
event_time_to_drop 1969-12-31 00:00:00 +0000 UTC is set to be slightly | ||
earlier than Unix epoch -1 (1969-12-31 23:59:59.999 +0000 UTC) | ||
As -1 is used on Numaflow to indicate watermark is not available, event_time_to_drop is | ||
used to indicate that the message is dropped hence, excluded from watermark calculation | ||
""" |
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.
Let's add this after the class docstring, in the same space
used to indicate that the message is dropped hence, excluded from watermark calculation | ||
""" | ||
|
||
event_time_to_drop = datetime(1969, 12, 31, 0, 0, 0, tzinfo=timezone.utc) |
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.
Do we really need this as a new field? Can't we just store this as a constant, and assign?
@@ -44,7 +53,7 @@ def __init__( | |||
|
|||
@classmethod | |||
def to_drop(cls: type[M]) -> M: | |||
return cls(b"", datetime(1, 1, 1, 0, 0), None, [DROP]) | |||
return cls(b"", Message.event_time_to_drop, None, [DROP]) |
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.
Something like:
return cls(b"", Message.event_time_to_drop, None, [DROP]) | |
return cls(b"", EVENT_TIME_TO_DROP, None, [DROP]) |
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.
let's make it a _const
Signed-off-by: Keran Yang <[email protected]>
Signed-off-by: Keran Yang <[email protected]>
Set the event time of messages to drop to epoch(0) - 1ms across all our SDKs.