New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BaseBranchOperator should push to xcom by default #13704
Comments
Strictly speaking it is possible because you can override the Apart from that your suggestion make sense to me - I don't see any drawbacks to that. Would you mind opening a PR? |
Hi! From what I understand the execute function in BaseBranchOperator does not return the value calculated by choose_branch. A simple change from -
to
should do the trick and Thank you. |
This change will BaseBranchOperator to do xcom push of the branch it choose to follow. It will also add support to use the do_xcom_push parameter. The added change returns the result received by running choose_branch().
This change will BaseBranchOperator to do xcom push of the branch it choose to follow. It will also add support to use the do_xcom_push parameter. The added change returns the result received by running choose_branch(). Closes: #13704
Apache Airflow version: 2.0.0
Kubernetes version (if you are using kubernetes) (use
kubectl version
):Not relevant
Environment:
Not relevant
What happened:
BranchPythonOperator performs xcom push by default since this is the behavior of PythonOperator.
However BaseBranchOperator doesn't do xcom push.
Note: It's impossible to push to xcom manually because the BaseBranchOperator has no return in it's execute method. So even when using
do_xcom_push=True
it won't helphttps://github.com/apache/airflow/blob/master/airflow/operators/branch.py#L52
What you expected to happen:
BaseBranchOperator to do xcom push of the branch it choose to follow as the default or at least to support the parameter of
do_xcom_push=True
The text was updated successfully, but these errors were encountered: