uranusjr opened a new pull request #20737:
URL: https://github.com/apache/airflow/pull/20737


   The previous implementation is a bit too convoluted for me to make sense, so 
I broke down the logic and rewrote the entire function to make sure all 
possibilities are covered. The current logic, as documented in the docstring, 
is:
   
   1. If the input `exec_date_or_run_id` matches a DAG run ID, return the run.
   2. Try to parse the input as a date. If that works, and the resulting date 
matches a DAG run’s logical date, return the run.
   3. If `create_if_necessary` is False and the input works for neither of the 
above, raise `DagRunNotFound`.
   4. Try to create a new DAG run. If the input looks like a date, use it as 
the logical date; otherwise use it as a run ID and set the logical date to the 
current time.
   
   Minor refacoring also added to satisfy Mypy. A TaskInstanceNotFound raise is 
also added to fix a logic error in `_get_ti()` caught by Mypy.
   
   Fix #20384.


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