zeroshade commented on code in PR #1822:
URL: https://github.com/apache/iceberg-go/pull/1822#discussion_r3807738959
##########
table/updates.go:
##########
@@ -221,12 +245,32 @@ func (u *Updates) UnmarshalJSON(data []byte) error {
default:
return fmt.Errorf("%w: unknown update action: %s",
iceberg.ErrInvalidArgument, base.ActionName)
}
- normalized, err :=
normalizeLegacyPropertyFields(base.ActionName, raw)
- if err != nil {
- return err
+ if normalizeLegacyPropertyFields(base.ActionName, object) {
+ var actionWire struct {
Review Comment:
**Major:** This raw discriminator check is reached only after successful
action dispatch and only for legacy property normalization, so exact
duplicate-key type errors still disappear on earlier exits. For both
`{"action":123,"action":"unknown"}` and `{"action":123,"action":null}`, the
merge base returns `*json.UnmarshalTypeError`; this head instead returns
“unknown update action” or the missing/null-action `ErrInvalidArgument` because
the map decode collapsed the earlier number before execution reaches here.
Please validate the original discriminator semantics before the null and
unknown-action exits, and extend the regression test across valid, unknown, and
null final values.
--
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]