Lee-W commented on code in PR #63962:
URL: https://github.com/apache/airflow/pull/63962#discussion_r2963857953
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -1912,17 +1912,18 @@ def _create_dag_runs(self, dag_models:
Collection[DagModel], session: Session) -
active_runs=active_runs_of_dags.get(dag_model.dag_id),
)
continue
- if dag_model.next_dagrun is None and
dag_model.timetable_partitioned is False:
+ if dag_model.next_dagrun is None and not
dag_model.timetable_partitioned:
self.log.error(
"dag_model.next_dagrun is None; expected datetime",
dag_id=dag_model.dag_id,
)
continue
if dag_model.next_dagrun_create_after is None:
- self.log.error(
- "dag_model.next_dagrun_create_after is None; expected
datetime",
- dag_id=dag_model.dag_id,
- )
+ if not dag_model.timetable_partitioned:
+ self.log.error(
+ "dag_model.next_dagrun_create_after is None; expected
datetime",
+ dag_id=dag_model.dag_id,
+ )
Review Comment:
```suggestion
if dag_model.timetable_partitioned is False:
# non partition-aware Dags
if dag_model.next_dagrun is None:
self.log.error(
"dag_model.next_dagrun is None; expected datetime",
dag_id=dag_model.dag_id,
)
continue
if dag_model.next_dagrun_create_after is None:
self.log.error(
"dag_model.next_dagrun_create_after is None;
expected datetime",
dag_id=dag_model.dag_id,
)
continue
else:
# partition-aware Dags
if dag_model.partition_key is None:
self.log.error(
"dag_model.next_dagrun_partition_key is None;
expected str",
dag_id=dag_model.dag_id,
)
```
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -1912,17 +1912,18 @@ def _create_dag_runs(self, dag_models:
Collection[DagModel], session: Session) -
active_runs=active_runs_of_dags.get(dag_model.dag_id),
)
continue
- if dag_model.next_dagrun is None and
dag_model.timetable_partitioned is False:
+ if dag_model.next_dagrun is None and not
dag_model.timetable_partitioned:
self.log.error(
"dag_model.next_dagrun is None; expected datetime",
dag_id=dag_model.dag_id,
)
continue
if dag_model.next_dagrun_create_after is None:
- self.log.error(
- "dag_model.next_dagrun_create_after is None; expected
datetime",
- dag_id=dag_model.dag_id,
- )
+ if not dag_model.timetable_partitioned:
+ self.log.error(
+ "dag_model.next_dagrun_create_after is None; expected
datetime",
+ dag_id=dag_model.dag_id,
+ )
Review Comment:
but overall idea is right
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -1912,17 +1912,18 @@ def _create_dag_runs(self, dag_models:
Collection[DagModel], session: Session) -
active_runs=active_runs_of_dags.get(dag_model.dag_id),
)
continue
- if dag_model.next_dagrun is None and
dag_model.timetable_partitioned is False:
+ if dag_model.next_dagrun is None and not
dag_model.timetable_partitioned:
self.log.error(
"dag_model.next_dagrun is None; expected datetime",
dag_id=dag_model.dag_id,
)
continue
if dag_model.next_dagrun_create_after is None:
- self.log.error(
- "dag_model.next_dagrun_create_after is None; expected
datetime",
- dag_id=dag_model.dag_id,
- )
+ if not dag_model.timetable_partitioned:
+ self.log.error(
+ "dag_model.next_dagrun_create_after is None; expected
datetime",
+ dag_id=dag_model.dag_id,
+ )
Review Comment:
I think we should do something like it
--
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]