You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "tomplus (via GitHub)" <gi...@apache.org> on 2025/03/07 18:43:03 UTC

[I] BranchPythonOperator.execute cannot be called outside TaskInstance! [airflow]

tomplus opened a new issue, #47511:
URL: https://github.com/apache/airflow/issues/47511

   ### Apache Airflow version
   
   2.10.5
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   For some reason BranchPythonOperator reports warning:
   
   ```
   [2025-03-07, 18:13:18 UTC] {local_task_job_runner.py:123} ▶ Pre task execution logs
   [2025-03-07, 18:13:19 UTC] {baseoperator.py:424} WARNING - BranchPythonOperator.execute cannot be called outside TaskInstance!
   [2025-03-07, 18:13:19 UTC] {python.py:240} INFO - Done. Returned value was: branch_b
   [2025-03-07, 18:13:19 UTC] {branch.py:38} INFO - Branch into branch_b
   [2025-03-07, 18:13:19 UTC] {skipmixin.py:233} INFO - Following branch ('branch_b',)
   [2025-03-07, 18:13:19 UTC] {skipmixin.py:281} INFO - Skipping tasks [('branch_c', -1), ('branch_d', -1), ('branch_a', -1)]
   [2025-03-07, 18:13:19 UTC] {taskinstance.py:341} ▶ Post task execution logs
   ```
   
   it's from example_branch_operator.
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   Run example 'example_branch_operator'.
   
   ### Operating System
   
   Ubuntu 22
   
   ### Versions of Apache Airflow Providers
   
   It's a fresh installation (pip install airflow)
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

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


Re: [I] BranchPythonOperator.execute cannot be called outside TaskInstance! [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on issue #47511:
URL: https://github.com/apache/airflow/issues/47511#issuecomment-3053672901

   This is 2.x specific.
   It was fixed in Airflow 3.0 by https://github.com/apache/airflow/pull/47523


-- 
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


Re: [I] BranchPythonOperator.execute cannot be called outside TaskInstance! [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #47511:
URL: https://github.com/apache/airflow/issues/47511#issuecomment-2707166578

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


-- 
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


Re: [I] BranchPythonOperator.execute cannot be called outside TaskInstance! [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #47511: BranchPythonOperator.execute cannot be called outside TaskInstance!
URL: https://github.com/apache/airflow/issues/47511


-- 
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


Re: [I] BranchPythonOperator.execute cannot be called outside TaskInstance! [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #47511:
URL: https://github.com/apache/airflow/issues/47511#issuecomment-5010418463

   This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.


-- 
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


Re: [I] BranchPythonOperator.execute cannot be called outside TaskInstance! [airflow]

Posted by "insomnes (via GitHub)" <gi...@apache.org>.
insomnes commented on issue #47511:
URL: https://github.com/apache/airflow/issues/47511#issuecomment-2709002941

   There was similar issue, where it was mentioned that it's not fixed yet:
   
   https://github.com/apache/airflow/issues/45498#issuecomment-2680642636
   
   I've also seen the same behaviour on current `main` branch with `TriggerDagRunOpertator`


-- 
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


Re: [I] BranchPythonOperator.execute cannot be called outside TaskInstance! [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #47511:
URL: https://github.com/apache/airflow/issues/47511#issuecomment-5324884559

   This issue has been closed because it has not received response from the issue author.


-- 
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


Re: [I] BranchPythonOperator.execute cannot be called outside TaskInstance! [airflow]

Posted by "NilsJPWerner (via GitHub)" <gi...@apache.org>.
NilsJPWerner commented on issue #47511:
URL: https://github.com/apache/airflow/issues/47511#issuecomment-3053384453

   This happens with any custom operator I use that wraps the EksPodOperator


-- 
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


Re: [I] BranchPythonOperator.execute cannot be called outside TaskInstance! [airflow]

Posted by "insomnes (via GitHub)" <gi...@apache.org>.
insomnes commented on issue #47511:
URL: https://github.com/apache/airflow/issues/47511#issuecomment-2709165365

   I think I was able to reproduce reliably, identify, and fix this bug in:
   
   https://github.com/apache/airflow/pull/47552
   
   But the code behind all of this is tricky so I am not 100% sure. 


-- 
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