Update task lifecycle diagram for missing states#46056
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
|
Nice. I do have some problem with just updating the image like that. It doesn't offer the ability to make changes easily. |
|
Is there a way we can easily get to update that picture when it changes in the future ? I am a big fan of generating such images from text / code rather than drawing them by hand. We even already have a number of such images generated from the code via pre-commit - using the cool Python file: https://github.com/apache/airflow/blob/main/docs/apache-airflow/img/diagram_basic_airflow_architecture.py And it's enough to re-run the python file to get the new diagram generated based on it. I somehow don't see a viable path how we can - in the future - easily modify such state diagram if all we have is the .png file or if we need some external tool (what?) to modify the diagram. Yes it might maybe look nicer when generated by hand, but for me long-term maintainabilty is far more important. Otherwise we will have exactly the same situation that we already experienced - where outdated pictures were basically "lying" to our users about someething - where they were supposed to reflect the reality. This is pretty much inevitable, if we have no easy way to regenerate the images with updated changes - and where drawing those by-hand is not really an option. WDYT @pykenny ? Maybe you should try to replicate the diagram using similar approach as our architecture diagrams? |
|
Got your point, I see how the project change its way to manage graphs since last year. That will just take longer to complete in my out-of-date dev environment, however (just realized PyCharm Community haven't had uv integration yet, at least not in their stable versions). (Update) PyCharm starts supporting uv environment from 2024.3.2 release. |
|
|
I know it better goes into discussion... but (Update)
(Update) From uv lockfile, seems that it blocks installing (Update) As the result, turned to using pip install approach as fallback, then |
Yep. that's likely. |
8eef60a to
42c2d3d
Compare
|
Okay, here's the new one with Also let me know if there's any wrong with the workflow described in the graph. For instance:
|
9bf9442 to
14344c9
Compare
14344c9 to
dbb0224
Compare
|
@potiuk any further comments? |
Details:
- Adds missing states to the diagram ("skipped" and
"deferred")
- Adds missing condition nodes to state transition
- Adds "trigger" component to the diagram
- Coverts multiple conditional branch in the graph into
sequence (multi-staged) of binary conditional branches
- Split states into three categories: "shared states",
"states only for sensors", and "states only for deferrable
tasks"
- Uses different icons to differentiate task states and Airflow
components
Details: - Adds conditions and transitions for tasks that only require triggerer to execute
Details: - Adds icon images to docs/diagrams - Adds 'diagram_task_lifecycle_diagram' script to generate lifecycle diagram with `diagrams` - Initial attempt to build up the graph, without label for condition branch edges, and some redundant edges
Details: - Adjusts branch label location by padding newline and whitespace - Uses `Edge` constructor to add label for condition branch edges - Removes redundant edges and correct incorrect edge directions
Details: - "diagram_task_lifecycle_diagram" > "diagram_task_lifecycle"
dbb0224 to
cb96c94
Compare
|
Rebased to make sure CI is green. I'll merge after |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
* Updates task lifecycle diagram for missing states
Details:
- Adds missing states to the diagram ("skipped" and
"deferred")
- Adds missing condition nodes to state transition
- Adds "trigger" component to the diagram
- Coverts multiple conditional branch in the graph into
sequence (multi-staged) of binary conditional branches
- Split states into three categories: "shared states",
"states only for sensors", and "states only for deferrable
tasks"
- Uses different icons to differentiate task states and Airflow
components
* Adds transitions for triggerer tasks
Details:
- Adds conditions and transitions for tasks that only require
triggerer to execute
* Make cycles look better
* [WIP] Initial attempt for generating diagram
Details:
- Adds icon images to docs/diagrams
- Adds 'diagram_task_lifecycle_diagram' script to generate
lifecycle diagram with `diagrams`
- Initial attempt to build up the graph, without label for
condition branch edges, and some redundant edges
* Adjusts branch labels; Adds label to condition branches
Details:
- Adjusts branch label location by padding newline and
whitespace
- Uses `Edge` constructor to add label for condition branch edges
- Removes redundant edges and correct incorrect edge directions
* Remove original image; Update documentation
* Adds legend cluster
* File renaming
Details:
- "diagram_task_lifecycle_diagram" > "diagram_task_lifecycle"
* Updates task lifecycle diagram for missing states
Details:
- Adds missing states to the diagram ("skipped" and
"deferred")
- Adds missing condition nodes to state transition
- Adds "trigger" component to the diagram
- Coverts multiple conditional branch in the graph into
sequence (multi-staged) of binary conditional branches
- Split states into three categories: "shared states",
"states only for sensors", and "states only for deferrable
tasks"
- Uses different icons to differentiate task states and Airflow
components
* Adds transitions for triggerer tasks
Details:
- Adds conditions and transitions for tasks that only require
triggerer to execute
* Make cycles look better
* [WIP] Initial attempt for generating diagram
Details:
- Adds icon images to docs/diagrams
- Adds 'diagram_task_lifecycle_diagram' script to generate
lifecycle diagram with `diagrams`
- Initial attempt to build up the graph, without label for
condition branch edges, and some redundant edges
* Adjusts branch labels; Adds label to condition branches
Details:
- Adjusts branch label location by padding newline and
whitespace
- Uses `Edge` constructor to add label for condition branch edges
- Removes redundant edges and correct incorrect edge directions
* Remove original image; Update documentation
* Adds legend cluster
* File renaming
Details:
- "diagram_task_lifecycle_diagram" > "diagram_task_lifecycle"
* Updates task lifecycle diagram for missing states
Details:
- Adds missing states to the diagram ("skipped" and
"deferred")
- Adds missing condition nodes to state transition
- Adds "trigger" component to the diagram
- Coverts multiple conditional branch in the graph into
sequence (multi-staged) of binary conditional branches
- Split states into three categories: "shared states",
"states only for sensors", and "states only for deferrable
tasks"
- Uses different icons to differentiate task states and Airflow
components
* Adds transitions for triggerer tasks
Details:
- Adds conditions and transitions for tasks that only require
triggerer to execute
* Make cycles look better
* [WIP] Initial attempt for generating diagram
Details:
- Adds icon images to docs/diagrams
- Adds 'diagram_task_lifecycle_diagram' script to generate
lifecycle diagram with `diagrams`
- Initial attempt to build up the graph, without label for
condition branch edges, and some redundant edges
* Adjusts branch labels; Adds label to condition branches
Details:
- Adjusts branch label location by padding newline and
whitespace
- Uses `Edge` constructor to add label for condition branch edges
- Removes redundant edges and correct incorrect edge directions
* Remove original image; Update documentation
* Adds legend cluster
* File renaming
Details:
- "diagram_task_lifecycle_diagram" > "diagram_task_lifecycle"



Purpose
Updates task state the Adds 2 missing states ("skipped", "deferred") to the diagram, with more details on state transition conditions.
Details
diagramslibrary for automated plotting and pre-commit integration; rename "task_lifecycle_diagram" to "diagram_task_lifecycle" to comply with pre-commit conditionRelated Issues
closes: #40185
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.