-
Notifications
You must be signed in to change notification settings - Fork 695
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
Remove Deck URI when OutputReader
is nil
#6223
Remove Deck URI when OutputReader
is nil
#6223
Conversation
Signed-off-by: Future-Outlier <[email protected]>
Code Review Agent Run #54fd06Actionable Suggestions - 2
Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
} | ||
|
||
if !exists && p.execInfo.OutputInfo != nil { | ||
if err != nil || !exists { |
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 separating error handling from existence check to improve code clarity. The current combined condition if err != nil || !exists {
makes the error handling less explicit.
Code suggestion
Check the AI-generated fix before applying
- if err != nil || !exists {
- p.execInfo.OutputInfo.DeckURI = nil
- }
-
- if err != nil {
+ if err != nil {
+ p.execInfo.OutputInfo.DeckURI = nil
return regErrors.Wrapf(err, "failed to check existence of deck file")
+ }
+
+ if !exists {
+ p.execInfo.OutputInfo.DeckURI = nil
}
Code Review Run #54fd06
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
@@ -775,7 +777,7 @@ func (t Handler) Handle(ctx context.Context, nCtx interfaces.NodeExecutionContex | |||
return pluginTrns.FinalTransition(ctx) | |||
} | |||
|
|||
func (t *Handler) ValidateOutput(ctx context.Context, nodeID v1alpha1.NodeID, i io.InputReader, | |||
func (t Handler) ValidateOutput(ctx context.Context, nodeID v1alpha1.NodeID, i io.InputReader, |
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 keeping the pointer receiver *Handler
instead of value receiver Handler
for consistency. The ValidateOutput
method appears to be used in multiple places and changing to value receiver could lead to unnecessary copying.
Code suggestion
Check the AI-generated fix before applying
func (t Handler) ValidateOutput(ctx context.Context, nodeID v1alpha1.NodeID, i io.InputReader, | |
func (t *Handler) ValidateOutput(ctx context.Context, nodeID v1alpha1.NodeID, i io.InputReader, |
Code Review Run #54fd06
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6223 +/- ##
===========================================
- Coverage 49.69% 36.86% -12.84%
===========================================
Files 872 1318 +446
Lines 66911 134534 +67623
===========================================
+ Hits 33252 49596 +16344
- Misses 30636 80617 +49981
- Partials 3023 4321 +1298
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
OutputReader
is nil
OutputReader
is nilOutputReader
is nil
Code Review Agent Run Status
|
Tracking issue
#5574
#3936
Why are the changes needed?
if the reader is
nil
, we should remove the deck URI.we should only check if the reader exists, then the deck will exist.
Note: it's possible to render deck in agent's any task and now it's only possible when executing
databricks agent
.related code snippet:
flyte/flyteplugins/go/tasks/plugins/webapi/agent/plugin.go
Lines 365 to 385 in 1f533ab
What changes were proposed in this pull request?
if the reader is
nil
, remove the deck URI.How was this patch tested?
remote execution with a sensor agent task.
Setup process
single binary.
Screenshots
Check all the applicable boxes
Related PRs
Docs link
Summary by Bito
This PR enhances the task handler by improving Deck URI removal logic when deck files are absent. The changes include adding null checks for OutputInfo, separating error handling from existence checks, and modifying the ValidateOutput method signature. These modifications result in more robust code with clearer error handling patterns.Unit tests added: False
Estimated effort to review (1-5, lower is better): 1