Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump croniter to fix an issue with 29 Feb cron expressions #38198

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,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>=39.0.0",
"deprecated>=1.2.13",
"dill>=0.2.2",
Expand Down
13 changes: 13 additions & 0 deletions tests/models/test_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2544,6 +2544,19 @@ def subdag(parent_dag_name, child_dag_name, args):
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)
hussein-awala marked this conversation as resolved.
Show resolved Hide resolved

def test_replace_outdated_access_control_actions(self):
outdated_permissions = {
"role1": {permissions.ACTION_CAN_READ, permissions.ACTION_CAN_EDIT},
Expand Down