Full support for top level JSON Schema validation for DagRun params? #21173
Replies: 3 comments
-
Hi @philippefutureboy the main reason to keep the |
Beta Was this translation helpful? Give feedback.
-
Hey @msumit! Thanks for #17100 and for your response.
Well the exact issue in our case was not that we used the extra keys, it's that none of the expected keys were passed. {"tenant_ids": ["<id>"], "rti_ids": ["<id>"], "force": true} When the new API expects {"filters": {"tenant.ids": ["<id>"], "rti.ids": ["<id>"]}, "force": true} So since tenant_ids and rti_ids were top level instead of within "filters", our DAG did not filter its actions accordingly.
is still a valid configuration because we want to be able to mass generate analyses for our clients, whether for testing purpose or live purpose. Let me know if you still have some questions :) |
Beta Was this translation helpful? Give feedback.
-
@philippefutureboy thanks for the explanation of your use case. I believe something can be done by extending |
Beta Was this translation helpful? Give feedback.
-
I am super grateful for the introduction of Advanced Params using json-schema (#17100), which has greatly improved the DX and QA-X of our data engineering pipeline.
This being said, yesterday we had an incident that turned out that could have been avoided would the implementation be slightly different.
One of our non-airflow servers called our Airflow API with a request to trigger a DagRun with a previous version of the configuration supported by said DAG.
It resulted in unexpected behaviour, and we scrambled to prevent further fallout.
Beyond the desync between the APIs of the two systems, the underlying issue was the following: The current implementation allowed "additionalProperties" at the top level. Example:
Given the following DAG:
There does not seem to be a way to validate that no additional properties (e.g. "c", "d", etc.) be provided to the conf.
This is important because in our case it would have prevented running a configuration that was supposed to filter the actions of the DAG, but did not because the props had a dot instead of an underscore.
So our patch was to do the following:
Hence the suggestion is:
Is there a way that the changes introduced in #17100 be modified to allow top-level jsonschema validation?
Beta Was this translation helpful? Give feedback.
All reactions