Visitar URL original
Always draw borders if task instance state is null or undefined by edwardwang888 · Pull Request #18033 · apache/airflow · GitHub
Skip to content

Always draw borders if task instance state is null or undefined - #18033

Merged
bbovenzi merged 5 commits into
apache:mainfrom
edwardwang888:fix_manual_null_state_ti_border
Sep 21, 2021
Merged

bbovenzi merged 5 commits into
apache:mainfrom
edwardwang888:fix_manual_null_state_ti_border

Conversation

@edwardwang888

@edwardwang888 edwardwang888 commented Sep 4, 2021 •

Copy link
Copy Markdown
Contributor

Task instances of manual runs are usually drawn without borders. However, when a task instance has null state, it blends into the background without a border. In this case, drawing a border makes sense, but draw it at reduced opacity to distinguish it from scheduled runs.

Task instances with undefined state were previously always drawn with full-opacity borders because external_trigger for these task instances was undefined. This has been fixed, so these task instances are now drawn with borders and the proper opacity, depending on whether they are part of manual or scheduled runs.

Common task instance properties are now defined in a single place, and external_trigger is included as a common property so that it will not be undefined as described above.

Fixes #16877.

Screenshots:

  1. DAG with one scheduled run and one manual run

image
2. Clear all task instances in manual run. This results in task instances with null state.

  • Before:

image

  • After:

image
3. Clear all task instances in the scheduled run

  • Before:

image

  • After:
    • Still works as expected

image
4. Add new tasks to the DAG. This results in task instances with undefined state:

  • Before:
    • No difference in borders of manual vs. scheduled run

image

  • After
    • Notice difference in border opacity

image
5. Mouseover effect of the scheduled run

  • Before:
    image
    image

  • After:

    • Still works as expected

image
image
6. Mouseover effect of the manual run

  • Before:
    • The mouseover behavior is inconsistent: one has mouseover effect and the other does not

image
image

  • After:
    • Both now have no mouseover effect

image
image


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg boring-cyborg Bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Sep 4, 2021
@edwardwang888
edwardwang888 marked this pull request as draft September 4, 2021 20:33
@edwardwang888
edwardwang888 force-pushed the fix_manual_null_state_ti_border branch 3 times, most recently from bfbad06 to 9b36c09 Compare September 6, 2021 23:19
@edwardwang888
edwardwang888 force-pushed the fix_manual_null_state_ti_border branch from 9b36c09 to 51a2a00 Compare September 6, 2021 23:44
@edwardwang888 edwardwang888 changed the title Always draw borders if task instance state is null Always draw borders if task instance state is null or undefined Sep 7, 2021
@edwardwang888 edwardwang888 reopened this Sep 7, 2021
@edwardwang888
edwardwang888 marked this pull request as ready for review September 7, 2021 01:36

@bbovenzi bbovenzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Would you mind adding some before and after screenshots for other reviewers to see the UI changes?

@edwardwang888

Copy link
Copy Markdown
Contributor Author

@bbovenzi Added the screenshots above!

@bbovenzi bbovenzi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions Bot added the okay to merge It's ok to merge this PR as it does not require more tests label Sep 15, 2021
@github-actions

Copy link
Copy Markdown
Contributor

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@edwardwang888

Copy link
Copy Markdown
Contributor Author

@bbovenzi Thanks! Quick question - do you know why attribute values are written as integers when standalone but as strings when part of a ternary operator? Is it just a style preference?

For example:

d3.select(this).transition().duration(duration)
.style('stroke-width', 3);
})

d3.select(this).transition().duration(duration)
.style('stroke-width', (dd) => (isDagRun(dd) ? '2' : '1'));
})

@bbovenzi

Copy link
Copy Markdown
Contributor

@edwardwang888 Honestly, I don't know. It doesn't make a difference if its a string or an integer.

@bbovenzi
bbovenzi merged commit d856b79 into apache:main Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues okay to merge It's ok to merge this PR as it does not require more tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleared task instances in manual runs should have borders

3 participants