Lee-W commented on code in PR #68266:
URL: https://github.com/apache/airflow/pull/68266#discussion_r3387436611
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -2137,13 +2199,24 @@ def _create_dagruns_for_partitioned_asset_dags(self,
session: Session) -> set[st
partition_dag_ids.add(apdr.target_dag_id)
run_after = timezone.utcnow()
+ partition_date: datetime | None = None
+ if timetable.partitioned:
+ if TYPE_CHECKING:
+ assert isinstance(timetable, PartitionedAssetTimetable)
Review Comment:
Digging into it turned up a cleaner fix than a `TypeGuard`.
I typed these helpers as `PartitionedAssetTimetable` because it was the only
partitioned consumer timetable. But they only ever call the base
`Timetable.get_partition_mapper(...)`, and since we support custom timetables,
the right fix is to widen the type to `Timetable` and just gate on the
`partitioned` flag — `if timetable.partitioned:`. That drops the `assert
isinstance(...)` boilerplate with no narrowing needed.
--
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]