bbovenzi commented on code in PR #76606:
URL: https://github.com/apache/airflow/pull/76606#discussion_r4529877102


##########
airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldDropdown.tsx:
##########
@@ -48,15 +46,10 @@ export const FieldDropdown = ({ name, namespace = 
"default", onUpdate }: Flexibl
   const options =
     param.schema.enum?.map((value) => ({
       label: labelLookup(value, param.schema.values_display),
-      value: String(value ?? NULL_STRING_VALUE),
+      value: toOptionValue(value),
     })) ?? [];
 
-  const currentValue =
-    param.value === null
-      ? (options.find((opt) => opt.value === NULL_STRING_VALUE) ?? null)
-      : enumTypes.includes(typeof param.value)
-        ? (options.find((opt) => opt.value === String(param.value)) ?? null)
-        : null;
+  const currentValue = options.find((opt) => opt.value === 
toOptionValue(param.value as ParamValue)) ?? null;

Review Comment:
   Let's try to avoid this `as` casting. See my other comment



-- 
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