You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/22 21:46:04 UTC

[GitHub] [airflow] bbovenzi opened a new pull request, #25244: Add dataset-triggered run type icon

bbovenzi opened a new pull request, #25244:
URL: https://github.com/apache/airflow/pull/25244

   Add a new icon for `dataset-triggered` dag run types. Now that we have a few runTypes, I moved the icon logic to its own component.
   
   <img width="711" alt="Screen Shot 2022-07-22 at 10 37 51 PM" src="https://user-images.githubusercontent.com/4600967/180572584-1aff17c3-edf5-446e-a1fa-1506e3451eef.png">
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bbovenzi commented on a diff in pull request #25244: Add dataset-triggered run type icon

Posted by GitBox <gi...@apache.org>.
bbovenzi commented on code in PR #25244:
URL: https://github.com/apache/airflow/pull/25244#discussion_r929807452


##########
airflow/www/static/js/dag/details/Header.tsx:
##########
@@ -54,33 +53,21 @@ const Header = () => {
 
   let runLabel;
   if (dagRun && runId) {
-    if (runId.includes('manual__') || runId.includes('scheduled__') || runId.includes('backfill__')) {
-      runLabel = (<Time dateTime={dagRun.dataIntervalStart || dagRun.executionDate} />);
-    } else {
-      runLabel = runId;
-    }
-    if (dagRun.runType === 'manual') {
-      runLabel = (
-        <>
-          <MdPlayArrow style={{ display: 'inline' }} />
-          {runLabel}
-        </>
-      );
-    } else if (dagRun.runType === 'backfill') {
-      runLabel = (
-        <>
-          <RiArrowGoBackFill style={{ display: 'inline' }} />
-          {runLabel}
-        </>
-      );
-    } else if (dagRun.runType === 'scheduled') {
-      runLabel = (
-        <>
-          <MdOutlineSchedule style={{ display: 'inline' }} />
-          {runLabel}
-        </>
-      );
-    }
+    // If a runId includes the runtype then parse the time, otherwise use the custom run id
+    const runName = (
+      runId.includes('manual__')
+      || runId.includes('scheduled__')
+      || runId.includes('backfill__')
+      || runId.includes('dataset_triggered__')

Review Comment:
   This was to display a formatted run date or the custom run id. I guess we should just always do the formatted date and show the run id below?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ashb commented on a diff in pull request #25244: Add dataset-triggered run type icon

Posted by GitBox <gi...@apache.org>.
ashb commented on code in PR #25244:
URL: https://github.com/apache/airflow/pull/25244#discussion_r929804711


##########
airflow/www/static/js/dag/details/Header.tsx:
##########
@@ -54,33 +53,21 @@ const Header = () => {
 
   let runLabel;
   if (dagRun && runId) {
-    if (runId.includes('manual__') || runId.includes('scheduled__') || runId.includes('backfill__')) {
-      runLabel = (<Time dateTime={dagRun.dataIntervalStart || dagRun.executionDate} />);
-    } else {
-      runLabel = runId;
-    }
-    if (dagRun.runType === 'manual') {
-      runLabel = (
-        <>
-          <MdPlayArrow style={{ display: 'inline' }} />
-          {runLabel}
-        </>
-      );
-    } else if (dagRun.runType === 'backfill') {
-      runLabel = (
-        <>
-          <RiArrowGoBackFill style={{ display: 'inline' }} />
-          {runLabel}
-        </>
-      );
-    } else if (dagRun.runType === 'scheduled') {
-      runLabel = (
-        <>
-          <MdOutlineSchedule style={{ display: 'inline' }} />
-          {runLabel}
-        </>
-      );
-    }
+    // If a runId includes the runtype then parse the time, otherwise use the custom run id
+    const runName = (
+      runId.includes('manual__')
+      || runId.includes('scheduled__')
+      || runId.includes('backfill__')
+      || runId.includes('dataset_triggered__')

Review Comment:
   Don't make any deicisions based on the `run_id` column -- `run_type` exists for this very purpose.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] ashb commented on a diff in pull request #25244: Add dataset-triggered run type icon

Posted by GitBox <gi...@apache.org>.
ashb commented on code in PR #25244:
URL: https://github.com/apache/airflow/pull/25244#discussion_r932029048


##########
airflow/www/static/js/dag/details/Header.tsx:
##########
@@ -54,33 +53,21 @@ const Header = () => {
 
   let runLabel;
   if (dagRun && runId) {
-    if (runId.includes('manual__') || runId.includes('scheduled__') || runId.includes('backfill__')) {
-      runLabel = (<Time dateTime={dagRun.dataIntervalStart || dagRun.executionDate} />);
-    } else {
-      runLabel = runId;
-    }
-    if (dagRun.runType === 'manual') {
-      runLabel = (
-        <>
-          <MdPlayArrow style={{ display: 'inline' }} />
-          {runLabel}
-        </>
-      );
-    } else if (dagRun.runType === 'backfill') {
-      runLabel = (
-        <>
-          <RiArrowGoBackFill style={{ display: 'inline' }} />
-          {runLabel}
-        </>
-      );
-    } else if (dagRun.runType === 'scheduled') {
-      runLabel = (
-        <>
-          <MdOutlineSchedule style={{ display: 'inline' }} />
-          {runLabel}
-        </>
-      );
-    }
+    // If a runId includes the runtype then parse the time, otherwise use the custom run id
+    const runName = (
+      runId.includes('manual__')
+      || runId.includes('scheduled__')
+      || runId.includes('backfill__')
+      || runId.includes('dataset_triggered__')

Review Comment:
   Good question. I guess this isn't really changing the behaviour here though.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] bbovenzi merged pull request #25244: Add dataset-triggered run type icon

Posted by GitBox <gi...@apache.org>.
bbovenzi merged PR #25244:
URL: https://github.com/apache/airflow/pull/25244


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org