rbelavadi opened a new pull request, #5676: URL: https://github.com/apache/texera/pull/5676
### What changes were proposed in this PR? Fix enum validator for optional operator properties. Currently, the validator uses `c.value ?? ""` which coerces undefined to empty string, then checks if `""` is in the enum. Since empty string is never a valid enum option, optional fields left blank always fail validation and show a spurious error to the user. Replace with `c.value == null` check — if the value is unset (null or undefined), the field passes validation. Only run the enum check if the user has actually entered a value. Before: `c.value ?? ""` — coerces no-input to empty string, always fails After: `c.value == null || mapSource.enum?.includes(c.value)` — allows unset values ### Any related issues, documentation, discussions? Fixes #3524 ### How was this PR tested? Manually verified the logic change: - `undefined == null` evaluates to true, so unset optional fields now pass validation - A field with an actual value still gets checked against the enum - Existing test suite passes ### Was this PR authored or co-authored using generative AI tooling? Co-authored using Claude (Anthropic). The fix was reviewed and verified by the author. -- 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]
