Fix the multi type render for params#66278
Fix the multi type render for params#66278shubhamraj-git wants to merge 6 commits intoapache:mainfrom
Conversation
jscheffl
left a comment
There was a problem hiding this comment.
Looks OK for me but... can you please also add some updates of the now handling into the RST docs describing parameters?
So as far as I see whenever more than one type is defined, the form, will render an object field? How are text values interpreted, e.g. if int+string is allowed and I enter "42". Will this be passed as number or string to the form?
|
@jscheffl I just pushed a commit, can you recheck again, it will infer type from provided value - for example - 45 as input in UI will be taken as "45" in case of ["string", "object"] |
Yeah. That is a bit better. Still can you add some RST as documentation so that people know about it (and potential limitations that come in your mind). Also as the logic might be prone to regressions, can you make a unit test for mapping with some "supported" examples? |
jscheffl
left a comment
There was a problem hiding this comment.
Would it make sense to add one demo to airflow-core/src/airflow/example_dags/example_params_ui_tutorial.py ?
Added a new example which have multiple multi-type examples |
a81af47 to
aff01e9
Compare
There was a problem hiding this comment.
Thanks for adding an example. But oh, we already have soo many and this is overwhelming adding one more. Can you add a new section in example_params_ui_tutorial.py which attempts to collect a lot of options already?
Before -
Type of params -
run_area : ["integer", "string"]
pipelines : ["string", "object"]
but the UI render marks run_area as integer and pipelines as string
After -
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.