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/09/23 08:44:07 UTC

[GitHub] [airflow] eladkal commented on issue #18454: BranchPythonOperator intermittently fails to find its downstream task ids

eladkal commented on issue #18454:
URL: https://github.com/apache/airflow/issues/18454#issuecomment-925615907


   I am able to reproduce with your code but this is because your code has a bug.
   
   The decision function:
   ```
   def decision(**kwargs):
       ingredient = kwargs["ti"].xcom_pull(key="ingredient")
       # should you put it on pizza?
       if ingredient in ingredients[:3]:
           return "order_pizza"
       elif ingredient in ingredients[4:6]:
           return "sandwich_instead"
       elif ingredient in ingredients[7:]:
           return "ask_advice"
   ```
   
   doesn't cover all possible cases. so when `pick_random_ingredient` hits `mayonase` the decision will return `None` resulting in the error you experienced.


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