jhtimmins commented on pull request #8702:
URL: https://github.com/apache/airflow/pull/8702#issuecomment-623787422


   @Acehaidrey Of course :) Always happy to take a look.
   
   I think the use case makes sense, but the implementation could be made more 
explicit.
   
   Personally, I think it'd make more sense to use keyword arguments for both, 
and then determine behavior by the presence/absence of values.
   
   ```python
   def _handle_execution_date_fn(self, execution_date=None, context={}):
           # Assert that either execution_date or context is None
                  # Otherwise, throw an exception.
           # if execution_date
                  # return self.execution_date_fn(execution_date)
           # return self.execution_date_fn(context)
   ```
   
   This would cover the following cases:
   1. Current behavior w just execution_date value
   2. Proposed behavior w context variables
   3. Proposed behavior w empty context dictionary
   
   Worth getting a few more pairs of eyes on this.
   
   What do you think about this approach?


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

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


Reply via email to