-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix(ui): Fix timeline and stage detail #26402
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAligns UI data mappings with updated task stats time properties and corrects operator filtering in the Stage Detail view by eliminating variable shadowing. Class diagram for updated task stats time properties in SplitView and SplitsclassDiagram
class TaskStats {
+createTimeInMillis
+firstStartTimeInMillis
+lastStartTimeInMillis
+lastEndTimeInMillis
+endTimeInMillis
}
class SplitView {
+data
+show
}
class Splits {
}
SplitView --> TaskStats : uses
Splits --> TaskStats : uses
Class diagram for corrected operator filtering in Stage Detail viewclassDiagram
class OperatorDetail {
+index
+operator
+tasks
+operatorTasks
}
class Pipeline {
+pipelineId
+operatorSummaries
}
class OperatorSummary {
+operatorId
}
OperatorDetail --> Pipeline : iterates
Pipeline --> OperatorSummary : contains
OperatorDetail --> OperatorSummary : filters
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey there - I've reviewed your changes - here's some feedback:
- Extract the repeated time mapping logic in QuerySplitsView and Splits into a shared utility to reduce duplication.
- Instead of using the generic name 'op' for the operator summary loop, consider a more descriptive name like 'operatorSummary' for clarity.
- Review other components for similar variable shadowing patterns to ensure consistent naming conventions across the codebase.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Extract the repeated time mapping logic in QuerySplitsView and Splits into a shared utility to reduce duplication.
- Instead of using the generic name 'op' for the operator summary loop, consider a more descriptive name like 'operatorSummary' for clarity.
- Review other components for similar variable shadowing patterns to ensure consistent naming conventions across the codebase.
## Individual Comments
### Comment 1
<location> `presto-ui/src/components/QueryStageView.jsx:190-191` </location>
<code_context>
tasksSorted.forEach(task => {
task.stats.pipelines.forEach(pipeline => {
if (pipeline.pipelineId === operator.pipelineId) {
- pipeline.operatorSummaries.forEach(operator => {
- if (operator.operatorId === operator.operatorId) {
- operatorTasks.push(operator);
+ pipeline.operatorSummaries.forEach(op => {
</code_context>
<issue_to_address>
**issue (bug_risk):** The previous comparison always evaluated to true, masking potential logic errors.
The previous comparison checked operator.operatorId against itself, which would always succeed. The revised comparison correctly checks op.operatorId against operator.operatorId, addressing the logic error.
</issue_to_address>
### Comment 2
<location> `presto-ui/src/components/StageDetail.jsx:192-193` </location>
<code_context>
tasksSorted.forEach(task => {
task.stats.pipelines.forEach(pipeline => {
if (pipeline.pipelineId === operator.pipelineId) {
- pipeline.operatorSummaries.forEach(operator => {
- if (operator.operatorId === operator.operatorId) {
- operatorTasks.push(operator);
+ pipeline.operatorSummaries.forEach(op => {
</code_context>
<issue_to_address>
**issue (bug_risk):** The previous self-comparison always returned true, which could lead to incorrect data aggregation.
Comparing op.operatorId with operator.operatorId now ensures only matching operator summaries are included in the aggregation.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
b3a0ebd to
c4beb9a
Compare
|
Hi @wanweitao thanks for the fix and update. Could you also check |
c4beb9a to
584876f
Compare
Thanks for pointing that out. The |
037ec21 to
d897e4e
Compare
|
@wanweitao Please check if there any tooltip or label related to the new field xxxTimeInMillis, may need format it before display. Except this, I don't have concerns. |
Hi, I just checked. Seems there's no other tooltip or label displaying this field. It's used in two places:
Hopefully I didn’t miss any other occurrences. |
d897e4e to
69f367c
Compare
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.
/LGTM
Description
Motivation and Context
N/A
Impact
Timeline
Stage Detail
Note: Number and figure of tasks are correct (1) after this fix.
Test Plan
N/A
Contributor checklist
Release Notes