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

Make param validation consistent for DAG validation and triggering #34248

Merged

Conversation

jscheffl
Copy link
Contributor

@jscheffl jscheffl commented Sep 9, 2023

This PR adjusts the DAG level Params validation to the validation also used during triggering and DAG constructor.

It resolves the problem reported in #34227 that params with a value of None are leading to invalid/unparsable DAGs after upgrade to Airflow 2.7.1 as a side effect of #33141 - reason is that the validation previously checked for has_value assuming that the schema also defines a required field.

How to test:

  • See all tests are green
  • Define a DAG with the code below and see that with the fix applied, the DAG is parse-able again and can be used:
@dag(
    dag_id="dag-example",
    start_date=datetime(2023, 2, 2, tz="America/New_York"),
    schedule="41 2 * * *",
    params={
        "any_param": None,
    },
):
    ...

closes: #34227
related: #31299, #31301

@potiuk potiuk added this to the Airflow 2.7.2 milestone Sep 9, 2023
@eladkal eladkal added the type:bug-fix Changelog: Bug Fixes label Sep 9, 2023
@potiuk potiuk merged commit 3e34079 into apache:main Sep 10, 2023
42 checks passed
ephraimbuddy pushed a commit that referenced this pull request Oct 5, 2023
@jscheffl jscheffl deleted the bugfix/null-param-validation-in-scheduled-dags branch October 28, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

100+ DAGs fail to import after update to 2.7.1 due to "params without default values"
3 participants