-
Notifications
You must be signed in to change notification settings - Fork 310
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
don't override timeout on with_overrides if not specified #3097
Conversation
Signed-off-by: Paul Dittamo <[email protected]>
Code Review Agent Run Status
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3097 +/- ##
===========================================
- Coverage 76.46% 46.74% -29.73%
===========================================
Files 218 203 -15
Lines 22505 21525 -980
Branches 2766 2779 +13
===========================================
- Hits 17209 10062 -7147
- Misses 4483 10967 +6484
+ Partials 813 496 -317 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Paul Dittamo <[email protected]>
Code Review Agent Run #01a35dActionable Suggestions - 3
Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
flytekit/core/node.py
Outdated
@@ -47,6 +47,8 @@ class Node(object): | |||
ID, which from the registration step | |||
""" | |||
|
|||
timeout_override_sentinel = object() |
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.
Consider if using object()
as a sentinel value is the best approach here. While it works, using a dedicated sentinel class or enum.Enum
could provide better type safety and clarity of intent.
Code suggestion
Check the AI-generated fix before applying
import datetime
+import enum
@@ -50,1 +50,4 @@
-timeout_override_sentinel = object()
+class TimeoutSentinel(enum.Enum):
+ NO_OVERRIDE = 'no_override'
+
+timeout_override_sentinel = TimeoutSentinel.NO_OVERRIDE
Code Review Run #01a35d
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
flytekit/core/node.py
Outdated
raise ValueError("timeout should be duration represented as either a datetime.timedelta or int seconds") | ||
if timeout is not Node.timeout_override_sentinel: | ||
if timeout is None: | ||
node_metadata._timeout = 0 |
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.
Consider using datetime.timedelta()
instead of 0
for timeout value to maintain consistency with the type system and other code paths.
Code suggestion
Check the AI-generated fix before applying
node_metadata._timeout = 0 | |
node_metadata._timeout = datetime.timedelta() |
Code Review Run #01a35d
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
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.
@pvditt For typing, I think this needs to be a timedelta object.
Signed-off-by: Paul Dittamo <[email protected]>
Signed-off-by: Paul Dittamo <[email protected]>
Signed-off-by: Paul Dittamo <[email protected]>
Code Review Agent Run #7ddfdbActionable Suggestions - 0Review Details
|
Signed-off-by: Paul Dittamo <[email protected]>
Signed-off-by: Paul Dittamo <[email protected]>
Code Review Agent Run #7f6c33Actionable Suggestions - 0Additional Suggestions - 10
Review Details
|
Tracking issue
fixes: flyteorg/flyte#6153
Why are the changes needed?
with_overrides set timeout to default of 0 if timeout param is not specified
What changes were proposed in this pull request?
How was this patch tested?
added unit tests
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link
Summary by Bito
This PR addresses multiple improvements: 1) Fixes a critical bug in with_overrides() method's timeout handling by introducing TIMEOUT_OVERRIDE_SENTINEL for better timeout case management, 2) Implements enhanced error handling and security improvements for private keys and webhooks, 3) Adds proper validation for shared memory formats and improves event loop management, 4) Includes comprehensive test coverage for all changes.Unit tests added: True
Estimated effort to review (1-5, lower is better): 5