dsuhinin commented on issue #45290:
URL: https://github.com/apache/airflow/issues/45290#issuecomment-6346917871

   hey @jscheffl . I'd like to pick this up.                                    
                                                                                
                                                                                
                                                                                
             
                                                                                
                                                                                
                                                                                
                                                                               
     I checked the new Airflow 3 UI and the problem is still there, just in a 
new costume. An array param is rendered as a plain textarea when the items are 
strings (or no item type is set), as a JSON editor for numbers and everything 
else, and as a multiselect when there are enum/examples. Same type="array", 
three different widgets.                                                        
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                               
     While playing with it I ran into a couple of actual bugs too. The worst 
one: Param([1, 2, 3], type="array") without items lands in the textarea, and if 
you just submit the form as-is, the value comes back as ["1", "2", "3"] — the 
numbers quietly become strings. Also, validation is uneven: the JSON editor 
checks numbers and objects but not integers or booleans, and the textarea 
checks nothing — hit Enter after the last line and you get an extra "" element 
in the array.                                                                   
                                                                                
        
                                                                                
                                                                                
                                                                                
                                                                               
     What I'd like to do about it: replace the string-array textarea with a 
chips/tag input used for all arrays. You type a value and press Enter to add 
it, pasting multiline text splits into one chip per line — so the "one value 
per line" entry that was asked to be preserved earlier in this thread keeps 
working, nobody has to write JSON. Each entry gets validated against items.type 
right there (type abc into a number array and the chip shows an error). Objects 
and nested arrays keep the JSON editor. As a bonus it looks consistent with the 
multiselect we already show for arrays with enum.                               
   
                                                                                
                                                                                
                                                                                
                                                                               
     If that feels like too much UI change, there's a smaller version: keep the 
textarea for string arrays, but route untyped arrays based on the actual values 
(all strings → textarea, otherwise JSON editor) so the coercion bug goes away, 
and fill the validation gaps in the JSON editor. The bug fixes happen in both 
versions, plus tests for these components — there are none at the moment. Which 
direction would you prefer?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to