You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2024/03/18 22:32:11 UTC
(airflow) 06/07: bump `croniter` to fix an issue with 29 Feb cron expressions (#38198)
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 62f636f0d4dc410e9dd366cc605477bbd520c821
Author: Hussein Awala <hu...@awala.fr>
AuthorDate: Sat Mar 16 01:08:40 2024 +0100
bump `croniter` to fix an issue with 29 Feb cron expressions (#38198)
(cherry picked from commit 2e3b1758246169b278e7d409ecff98532ec18c18)
---
pyproject.toml | 2 +-
tests/models/test_dag.py | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 001dd86d37..2a3cac3008 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -87,7 +87,7 @@ dependencies = [
# This limit can be removed after https://github.com/apache/airflow/issues/35234 is fixed
"connexion[flask]>=2.10.0,<3.0",
"cron-descriptor>=1.2.24",
- "croniter>=0.3.17",
+ "croniter>=2.0.2",
"cryptography>=0.9.3",
"deprecated>=1.2.13",
"dill>=0.2.2",
diff --git a/tests/models/test_dag.py b/tests/models/test_dag.py
index 152bed8e94..31a7460704 100644
--- a/tests/models/test_dag.py
+++ b/tests/models/test_dag.py
@@ -2453,6 +2453,19 @@ my_postgres_conn:
next_subdag_info = subdag.next_dagrun_info(None)
assert next_subdag_info is None, "SubDags should never have DagRuns created by the scheduler"
+ def test_next_dagrun_info_on_29_feb(self):
+ dag = DAG(
+ "test_scheduler_dagrun_29_feb", start_date=timezone.datetime(2024, 1, 1), schedule="0 0 29 2 *"
+ )
+
+ next_info = dag.next_dagrun_info(None)
+ assert next_info and next_info.logical_date == timezone.datetime(2024, 2, 29)
+
+ next_info = dag.next_dagrun_info(next_info.data_interval)
+ assert next_info.logical_date == timezone.datetime(2028, 2, 29)
+ assert next_info.data_interval.start == timezone.datetime(2028, 2, 29)
+ assert next_info.data_interval.end == timezone.datetime(2032, 2, 29)
+
def test_replace_outdated_access_control_actions(self):
outdated_permissions = {
"role1": {permissions.ACTION_CAN_READ, permissions.ACTION_CAN_EDIT},