bbovenzi commented on code in PR #46631:
URL: https://github.com/apache/airflow/pull/46631#discussion_r1952857993
##########
airflow/ui/src/components/DurationChart.tsx:
##########
@@ -53,14 +54,16 @@ const average = (ctx: PartialEventContext, index: number)
=> {
return values === undefined ? 0 : values.reduce((initial, next) => initial +
next, 0) / values.length;
};
-export const RunDuration = ({
- runs,
- totalEntries,
+type RunResponse = DAGRunResponse | TaskInstanceResponse;
+
+export const DurationChart = ({
+ entries,
+ kind,
}: {
- readonly runs: Array<DAGRunResponse> | undefined;
- readonly totalEntries: number;
+ readonly entries: Array<RunResponse> | undefined;
+ readonly kind: string;
Review Comment:
```suggestion
readonly kind: "Dag Run" | "Task Instance";
```
Let's be more specific than just string
##########
airflow/ui/src/components/DurationChart.tsx:
##########
@@ -53,14 +54,16 @@ const average = (ctx: PartialEventContext, index: number)
=> {
return values === undefined ? 0 : values.reduce((initial, next) => initial +
next, 0) / values.length;
};
-export const RunDuration = ({
- runs,
- totalEntries,
+type RunResponse = DAGRunResponse | TaskInstanceResponse;
+
+export const DurationChart = ({
+ entries,
+ kind,
}: {
- readonly runs: Array<DAGRunResponse> | undefined;
- readonly totalEntries: number;
+ readonly entries: Array<RunResponse> | undefined;
+ readonly kind: string;
Review Comment:
That would catch the bug we have now where we expect "Task Instances" but
we're sending "Task Instance"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]