Skip to content

Report invalid language SDK cron schedules as import errors - #77176

Open
aaron-y-chen wants to merge 2 commits into
apache:mainfrom
aaron-y-chen:fix/lang-sdk-invalid-cron
Open

aaron-y-chen wants to merge 2 commits into
apache:mainfrom
aaron-y-chen:fix/lang-sdk-invalid-cron

Conversation

@aaron-y-chen

Copy link
Copy Markdown
Contributor

Problem

Go/Java SDKs check cron shape but leave range validation to core. Unlike Python Dag parsing, language SDK parsing omitted timetable.validate(), so 0 24 * * * was accepted without an import error and could not be scheduled.

Reproduction

On main branch, apply only the new regression test, without the production fix, and run the command below. The fake runtime returns an invalid-cron Dag alongside a valid daily Dag; both CronTriggerTimetable and CronDataIntervalTimetable cases fail because the invalid Dag remains accepted.

uv run --project airflow-core --no-sync pytest \
  airflow-core/tests/unit/dag_processing/test_lang_sdk_processor.py::TestLangSDKDagFileProcessorProcess::test_a_dag_with_an_invalid_cron_is_an_import_error \
  -v --tb=short --show-capture=no
image

Fix

Call deserialized.timetable.validate() in the language SDK processor to reuse core's validator. Existing error handling records an import error and excludes the invalid Dag while preserving valid Dags in the same result.


Was generative AI tooling used to co-author this PR?
  • Yes — OpenAI Codex (GPT-6)

Generated-by: OpenAI Codex (GPT-6) following the guidelines

@github-actions github-actions Bot added the fork ci required Gated by AIP-120: CI must pass in the contributor's fork. Managed by the fork CI reconciler. label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Fork CI: green. CI for the latest commit passed in your fork. The pull request is ready for maintainer review.

Pull requests from contributors run their CI in the contributor's own fork. GitHub Actions is free and has no minute limit on public forks, while the CI capacity of the Apache Software Foundation is shared by every ASF project and is finite.

Fork CI tested this branch merged with main at bada0686ef, as project CI would, 1 commits behind main when the run turned green.

Latest run: https://github.com/aaron-y-chen/airflow/actions/runs/43970410672

How this works: CI in your fork.


This comment was posted automatically by the fork CI monitor from templates drafted with an AI-assisted tool, so it may contain mistakes. An Apache Airflow maintainer, a real person, will review the pull request once its fork CI is green. Why the first pass is automated.

@aaron-y-chen
aaron-y-chen marked this pull request as ready for review November 16, 2026 22:28
@github-actions github-actions Bot added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Nov 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:DAG-processing fork ci required Gated by AIP-120: CI must pass in the contributor's fork. Managed by the fork CI reconciler. ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant