dstandish commented on code in PR #32538:
URL: https://github.com/apache/airflow/pull/32538#discussion_r1261585319
##########
airflow/operators/python.py:
##########
@@ -251,27 +253,37 @@ def execute(self, context: Context) -> Any:
self.log.info("Proceeding with downstream tasks...")
return condition
- downstream_tasks = context["task"].get_flat_relatives(upstream=False)
- self.log.debug("Downstream task IDs %s", downstream_tasks)
+ if not self.downstream_task_ids:
+ self.log.info("No downstream tasks; nothing to do.")
+ return
- if downstream_tasks:
- dag_run = context["dag_run"]
- execution_date = dag_run.execution_date
+ dag_run = context["dag_run"]
+ execution_date = dag_run.execution_date
+ if TYPE_CHECKING:
+ assert isinstance(execution_date, DateTime)
Review Comment:
Logical date is typed as `datetime` too it seems.
And worse, it does not exist on DagRunPydantic, so mypy complains about
that. i'm just keeping the insert
--
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]