-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameters not rendered correctly in 2.7.0 UI #33923
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
I can look into this, feel free to assign to me. |
All yours @SamWheating! |
Empty lists being rendered as I agree the integer thing is actually a bug. With I'd also be OK to contribute a fix if a desire is having this on short term. Update: I also just realized the "null"/
|
But then if one defaults the value of a parameters to an empty list, and build everything that uses it around the premises of receiving an iterable, things will break when receiving |
Question is what "everything" means in your case. In Jinja you can On the other hand if an empty list would be passed as I'd prefer to keep it consistent that "missing data" is passed as |
I see your point, but |
I agree that there should be a way to pass either a null or an empty list through the form interface without any workarounds, but I think it will require some more changes (maybe we'll have to include the I'll draft up some possible implementations and we can chat on the PR. |
If the field is a list and is required anyway then I would expect that also at least one element needs to be returned - an empty list for me does not represent a valid value if defined as The main difference we have is how to define a "non required or empty array" as result and technically all is possible. But the form can not distinguish whether |
I think that for any of these there is a clear difference between "empty" values ( I also acknowledge that this definitely adds some complexity implementation-side and probably won't make any difference for 99% of use cases.
Yes, I think that both |
Yes, empty list would be a valid option in my DAG (with all discussed so far still holding, I could just rewrite the implementation so that null is allowed and the rest of the DAG is adjusted accordingly) |
I'd propose to close this ticket and separate-out the empty list thing into a second discussion/feature ticket. This will not make it (including discussion) into 2.7.1. |
Apache Airflow version
2.7.0
What happened
When initialising integer parameters as 0, or arrays as empty list, the default behaviour of the UI is to render it as null.
This results in default parameters being ignored unless re-imputed manually.
Passing a config like this:
results in this in the UI when the DAG loads, forcing the user to manually input again 0, or editing the json for having an empty list
What you think should happen instead
0 rendered as 0, empty lists as empty lists
How to reproduce
This DAG should be an MVP for reproducing the error
Operating System
macOS M1 locally
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
Using this image:
https://hub.docker.com/layers/apache/airflow/2.7.0-python3.10/images/sha256-d6cb37572c21546ba3e60274d3cc1e782cc517a31443b8051702b19584e7379b?context=explore
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: