aaron-y-chen commented on code in PR #58543:
URL: https://github.com/apache/airflow/pull/58543#discussion_r3736253780
##########
task-sdk/src/airflow/sdk/definitions/timetables/assets.py:
##########
@@ -84,3 +85,23 @@ class AssetOrTimeSchedule(AssetTriggeredTimetable):
def __attrs_post_init__(self) -> None:
self.active_runs_limit = self.timetable.active_runs_limit
self.can_be_scheduled = self.timetable.can_be_scheduled
+
+
[email protected](kw_only=True)
+class AssetAndTimeSchedule(BaseTimetable):
+ """
+ Combine time-based scheduling with asset conditions.
+
+ :param assets: An asset or list of assets, in the same format as
+ ``DAG(schedule=...)`` when using event-driven scheduling. This is used
+ to evaluate whether a scheduled run can be created.
+ :param timetable: A timetable instance to evaluate time-based scheduling.
+ """
+
+ asset_gated = True
+ asset_condition: BaseAsset = attrs.field(alias="assets",
converter=_coerce_assets)
+ timetable: BaseTimetable
+
+ def __attrs_post_init__(self) -> None:
+ self.active_runs_limit = self.timetable.active_runs_limit
+ self.can_be_scheduled = self.timetable.can_be_scheduled
Review Comment:
If I change it to `properties`, do I also need to update the
`AssetOrTimeSchedule` part?
https://github.com/apache/airflow/blob/e24f5294645c20f55069c2f2a1b890eb3ff8cc2a/task-sdk/src/airflow/sdk/definitions/timetables/assets.py#L84-L86
--
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]