ashb commented on a change in pull request #20000:
URL: https://github.com/apache/airflow/pull/20000#discussion_r763076763



##########
File path: airflow/models/baseoperator.py
##########
@@ -1301,8 +1305,13 @@ def run(
         from airflow.models import DagRun
         from airflow.utils.types import DagRunType
 
-        start_date = start_date or self.start_date
-        end_date = end_date or self.end_date or timezone.utcnow()
+        # Assertions for typing -- we need a dag, for this function, and when 
we have a DAG we are
+        # _guaranteed_ to have start_date (else we couldn't have been added to 
a DAG)
+        if TYPE_CHECKING:
+            assert self.start_date

Review comment:
       K, I think it's this, or a `raise RuntimeError`.
   
   Anyone have a preference?




-- 
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-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to