worryg0d commented on code in PR #1942:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1942#discussion_r3492634200
##########
marshal.go:
##########
@@ -2749,9 +2749,12 @@ func (udtCQLType) TypeInfoFromParams(proto int, params
[]interface{}) (TypeInfo,
return nil, fmt.Errorf("expected []UDTField for udt, got %T",
params[2])
}
return UDTTypeInfo{
- Keyspace: keyspace,
- Name: name,
- Elements: elements,
+ Keyspace: keyspace,
+ Name: name,
+ Elements: elements,
+ encodeNilMapAsNull: u.types.encodeNilMapAsNull,
+ warnOnNilMap: u.types.warnOnNilMap,
+ logger: u.types.logger,
}, nil
Review Comment:
I'm not comfortable passing configurations and the logger deep into the
corresponding marshaler in such a way because it complicates things and makes
it more error-prone. For example, in unit tests we're using `GlobalTypes` which
defaults `warnOnNilMap` to true, so any created `UDTTypeInfo` object would
inherit its value as well, but our unit tests don't cover it.
Right now I just intentionally called `WithNullableUDTs` so the warning is
disabled, but this is anyway far from ideal...
--
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]