Skip to content

Commit

Permalink
Remove tasks from dag run duration, fix bar chart opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
bbovenzi committed Feb 29, 2024
1 parent de81481 commit 5800f71
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions airflow/www/static/js/dag/details/dag/RunDurationChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { useGridData } from "src/api";
import { getDuration, formatDateTime, defaultFormat } from "src/datetime_utils";
import ReactECharts, { ReactEChartsProps } from "src/components/ReactECharts";
import type { DagRun } from "src/types";
import { getTask } from "src/utils";

interface RunDuration extends DagRun {
landingDuration: moment.Duration;
Expand All @@ -44,21 +43,15 @@ interface Props {
}

const RunDurationChart = ({ showLandingTimes }: Props) => {
const {
selected: { taskId },
onSelect,
} = useSelection();
const { onSelect } = useSelection();

const {
data: { dagRuns, groups, ordering },
data: { dagRuns, ordering },
} = useGridData();

let maxDuration = 0;
let unit = "seconds";

const task = getTask({ taskId, task: groups });

if (!task) return null;
const orderingLabel = ordering[0] || ordering[1] || "startDate";

const durations: (RunDuration | {})[] = dagRuns.map((dagRun) => {
Expand Down Expand Up @@ -201,6 +194,7 @@ const RunDurationChart = ({ showLandingTimes }: Props) => {
type: "bar",
barMinHeight: 1,
itemStyle: {
opacity: 1,
// @ts-ignore
color: (params) => stateColors[params.data.state],
},
Expand Down Expand Up @@ -254,7 +248,6 @@ const RunDurationChart = ({ showLandingTimes }: Props) => {
// @ts-ignore
click(params) {
onSelect({
taskId: params.data.taskId,
runId: params.data.runId,
});
},
Expand Down

0 comments on commit 5800f71

Please sign in to comment.