EnxDev commented on PR #43459:
URL: https://github.com/apache/superset/pull/43459#issuecomment-5451651705

   Thanks for the review, @msyavuz — addressed both:
   
   1. Fixed the root cause at `commands/dataset/update.py` (both 
`_validate_expressions:386` and `_validate_fetch_values_predicate:414`): the 
`ValidationError` message is now wrapped in a list (`[message]`) explicitly, so 
the 422 response keeps its documented `{field: [msg]}` shape regardless of 
whether the underlying message is a `str` or a `LazyString` (marshmallow's own 
`isinstance(message, (str, bytes))` check doesn't cover `LazyString`, which is 
what caused the bare-string storage). Added a regression assertion in 
`update_test.py` checking `messages` stays a list.
   
   2. Checked the nested-object case (`{"recipients": {"0": {"type": [...]}}}`) 
— confirmed it's already handled safely by the `getFirstValidationError` helper 
that landed independently on master via #43631 (merged into this branch): a 
non-string/non-array field value returns `undefined` and falls back to 
`t('Invalid input')` rather than leaking an object into `error.error`. Verified 
with a scratch test. Left out of scope for this PR since it's pre-existing 
generic-fallback behavior, not a regression.
   
   Also resolved the merge conflicts with master — #43631 landed the same 
frontend fix (`getFirstValidationError`) independently while this PR was open, 
so I kept master's implementation for `getClientErrorObject.ts`/test and 
layered the backend fix on top.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to