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 2021/06/24 00:58:58 UTC
[GitHub] [airflow] josh-fell opened a new pull request #16624: Adding task dependency for `example_kubernetes` DAG
josh-fell opened a new pull request #16624:
URL: https://github.com/apache/airflow/pull/16624
Adding task dependency between tasks that involve generating an `XCom` in one task and consuming said `XCom` in the other. The current DAG has these tasks executing in parallel.
---
**^ 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 change, 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 [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] josh-fell commented on pull request #16624: Adding task dependency for `example_kubernetes` DAG
Posted by GitBox <gi...@apache.org>.
josh-fell commented on pull request #16624:
URL: https://github.com/apache/airflow/pull/16624#issuecomment-867725810
This change enforces the proper dependency between a task that writes an `XCom` and one that consumes the same `XCom`.
```python
write_xcom = KubernetesPodOperator(
namespace="default",
image="alpine",
cmds=[
"sh",
"-c",
"mkdir -p /airflow/xcom/;echo '[1,2,3,4]' > /airflow/xcom/return.json",
],
name="write-xcom",
do_xcom_push=True,
is_delete_operator_pod=True,
in_cluster=True,
task_id="write-xcom",
get_logs=True,
)
pod_task_xcom_result = BashOperator(
bash_command="echo \"{{ task_instance.xcom_pull('write-xcom')[0] }}\"",
task_id="pod_task_xcom_result",
)
```
As written currently both of these tasks execute in parallel.
![image](https://user-images.githubusercontent.com/48934154/123288428-91911f00-d4dd-11eb-9957-b18450003fbc.png)
But the should execute sequentially.
![image](https://user-images.githubusercontent.com/48934154/123288358-7de5b880-d4dd-11eb-9d0c-eda1ac4fee3e.png)
This dependency would be handled by converting the `xcom_pull` in the "pod_task_xcom_result" task to use the Taskflow API but accessing specific values from an operator `.output` is not supported yet (see #16618). Yes, this is an example but the functional dependencies should be correct for users to reference.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk merged pull request #16624: Adding task dependency for `example_kubernetes` DAG
Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #16624:
URL: https://github.com/apache/airflow/pull/16624
--
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] potiuk merged pull request #16624: Adding task dependency for `example_kubernetes` DAG
Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #16624:
URL: https://github.com/apache/airflow/pull/16624
--
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] github-actions[bot] commented on pull request #16624: Adding task dependency for `example_kubernetes` DAG
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #16624:
URL: https://github.com/apache/airflow/pull/16624#issuecomment-869858335
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.
--
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] github-actions[bot] commented on pull request #16624: Adding task dependency for `example_kubernetes` DAG
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #16624:
URL: https://github.com/apache/airflow/pull/16624#issuecomment-869858335
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.
--
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] uranusjr commented on pull request #16624: Adding task dependency for `example_kubernetes` DAG
Posted by GitBox <gi...@apache.org>.
uranusjr commented on pull request #16624:
URL: https://github.com/apache/airflow/pull/16624#issuecomment-867710102
This is just an example. What does this change affect?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org