shashbha14 commented on code in PR #66102:
URL: https://github.com/apache/airflow/pull/66102#discussion_r3194450909
##########
task-sdk/src/airflow/sdk/definitions/timetables/_cron.py:
##########
@@ -27,13 +27,32 @@
from pendulum.tz.timezone import FixedTimezone, Timezone
+# Mirrors airflow.utils.dates.cron_presets in airflow-core (the SDK cannot
+# import core). If a preset is added or changed here it must also be updated
+# there, and vice-versa.
+CRON_PRESETS: dict[str, str] = {
+ "@hourly": "0 * * * *",
+ "@daily": "0 0 * * *",
+ "@weekly": "0 0 * * 0",
+ "@monthly": "0 0 1 * *",
+ "@quarterly": "0 0 1 */3 *",
+ "@yearly": "0 0 1 1 *",
+}
+
Review Comment:
Instead of a pre-commit hook, made airflow-core re-export directly:
'from airflow.sdk.definitions.timetables._cron import CRON_PRESETS as
cron_presets' in 'airflow/utils/dates.py'. The SDK is now the single source of
truth ,no duplication, no sync 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]