Skip to content

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
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