Replies: 3 comments 3 replies
-
An update: I changed the params to include schema field directly like this, and the JSON Schema bit has begun working consistently.
However, now the default value is not used at all. In the DAG Run trigger page, I now see this:
This is overall better, but I'm wondering why I can't get both the default value and consistent JSON Schema validation for this case. |
Beta Was this translation helpful? Give feedback.
-
It might be an issue with the pickled/serialized DAG. I have a setup with Scheduler and web server running in different pods. From the scheduler if I run the following code (with the example given above), things seem fine (because the dag bag is constructed from the files I think):
But in the web server process (in Flask app context), this is what I get:
Just for ref, the code I used in Flask's context is this:
Because the web server's code actually does I think this a bug. @varunkvv @potiuk Would you want to file a bug or should I go ahead? |
Beta Was this translation helpful? Give feedback.
-
I don't know if anyone managed to solve this, but I tried with the kwarg "schema" and it kinda worked. Now the The other thing I noticed is that the I went to the param.py code and I found that when
Is there any way to fix this without using the schema keyword? |
Beta Was this translation helpful? Give feedback.
-
I'm unsure if this is a bug or I'm doing something wrong. This is on Airflow v2.3.0
To set the context, I'm trying to create a DAG using JSON Schema / Param:
In particular, the 'accounts' field takes an array that can take an arbitrary number of objects, but with a fixed schema.
When I go to the Airflow's "Trigger DAG w/ config" page the default shows up like this:
This seems to get passed verbatim to the DAG itself, which is not correct.
What does seem to mostly work is the JSON Schema itself. For example, if I put a wrong type for
accounts.country
it gives the correct error message. So the issue mostly seems to be about rendering the default parameters in the UI (and possibly the dependent backends).EDIT: the issue with required below was on my end, can be ignored.
On a secondary note, it looks like addingrequired
modifiers to the JSON Schema completely breaks the DAG parsing. The DAG does not show up, and it does not provide an error message on the top. I can file an issue for this if deemed appropriate.Beta Was this translation helpful? Give feedback.
All reactions