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 2022/02/27 17:25:40 UTC

[GitHub] [airflow] potiuk commented on pull request #20656: Update base sensor operator to support XCOM return value

potiuk commented on pull request #20656:
URL: https://github.com/apache/airflow/pull/20656#issuecomment-1053622390


   > It's good with me. I recall @potiuk that you were trying to find a way to make it possible to return a tuple. But I think this change should be compatible with that. What we _could_ consider doing is, for 3.0, make it so a sensor must be true / false or PRV (i.e., no longer support "truthy" values) and then in 3.1 we could add support for tuple. WDYT?
   
   I am  good for it actually as is. I think we do not need to do anything more :) .
   Comparing to our discussion I think the main difference is that the The PokeReturnValue with __bool__ will actually return true/false properly even for older versions of Airlfow (but it will not store xcom value).
   
   And you should be able to start using it in our community providers even now. The way it should be done is 
   
   ```
   try:
      from ... import PokeReturnValue
   except ImportError:
      PokeReturnValue = None
   
   ...
   
       if PokeReturnValue is not None:
            return PokeReturnValue(is_done, xcom_value)
       else:
           return is_done
   ```
   
   I think we will figure out the details with the first sensor which will use it (and it will be detected in CI by failing import for 2.1) and we can - then add some pre-commit checks and better information for the developers of providers (but this can be done later).
   


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