Skip to content
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

Merged
merged 4 commits into from
Oct 13, 2023

Conversation

KeranYang
Copy link
Member

@KeranYang KeranYang commented Oct 13, 2023

Set the event time of messages to drop to epoch(0) - 1ms across all our SDKs.

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
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #115 (b0a93ec) into main (0cbaa5d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           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           
Files Coverage Δ
pynumaflow/_constants.py 100.00% <100.00%> (ø)
pynumaflow/sourcetransformer/__init__.py 100.00% <100.00%> (ø)
pynumaflow/sourcetransformer/_dtypes.py 92.85% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@KeranYang KeranYang requested a review from a team October 13, 2023 17:50
Comment on lines 15 to 20
"""
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
"""
Copy link
Member

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)
Copy link
Member

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])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like:

Suggested change
return cls(b"", Message.event_time_to_drop, None, [DROP])
return cls(b"", EVENT_TIME_TO_DROP, None, [DROP])

Copy link
Member

@vigith vigith left a 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]>
@KeranYang KeranYang requested review from ab93 and vigith October 13, 2023 19:39
.
Signed-off-by: Keran Yang <[email protected]>
@KeranYang KeranYang merged commit 7b90d4d into numaproj:main Oct 13, 2023
9 checks passed
@KeranYang KeranYang deleted the drop-ts branch October 13, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants