dstandish commented on pull request #20546:
URL: https://github.com/apache/airflow/pull/20546#issuecomment-1002685808


   Yeah I knew this approach is dangerous and that's why I also explored using 
a class  here https://github.com/apache/airflow/pull/20547.
   
   Using that class is more heavyhanded but it allows us to precisely know the 
implementer's intention.
   
   But your idea about "always returning the truthy value" as xcom is 
interesting.
   
   The the only problems are, what if you want to return something that doesn't 
behave correctly with  respect to truthyness.
   
   In fact, pandas dataframes don't allow this!
   
   ```python
   import pandas as pd
   
   df = pd.DataFrame([1,2,3])
   
   if df:
       print('hi')
   ```
   
   The other (smaller) concern would be unnecessary xcom pushing when the user 
does not need xcom.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to