jscheffl commented on code in PR #62060:
URL: https://github.com/apache/airflow/pull/62060#discussion_r2818830880
##########
airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldDropdown.tsx:
##########
@@ -25,12 +25,15 @@ import { paramPlaceholder, useParamStore } from
"src/queries/useParamStore";
import type { FlexibleFormElementProps } from ".";
-const labelLookup = (key: string, valuesDisplay: Record<string, string> |
undefined): string => {
+const labelLookup = (key: number | string | null, valuesDisplay:
Record<string, string> | undefined): string => {
+ // Convert null to string to avoid issues with object key lookup
+ const stringKey = key === null ? "null" : String(key);
Review Comment:
I think the replacement is a good idea such that the used library does not
fail. But in my view the literal `null` looks a bit dangerous as I assume it
might be really used as a value / string.
Would it be possible to rather switch to some exotic string with less
potential for clash like `__null__` or `__#null#__`? Woul dbe good to define
this as constant that it is used consistently in code.
##########
airflow-core/src/airflow/example_dags/example_params_ui_tutorial.py:
##########
@@ -151,6 +151,7 @@
7: "Seven",
8: "Eight",
9: "Nine",
+ None: "None (clear selection)",
Review Comment:
It seems the values display for `null` is not working, it always displays
`null`as literal:
<img width="950" height="568" alt="Image"
src="https://github.com/user-attachments/assets/8715ab0b-877a-406b-992d-6020fd7d46e8"
/>
--
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]