lzaeh commented on code in PR #2335:
URL: https://github.com/apache/fory/pull/2335#discussion_r2144542562
##########
python/pyfory/_struct.py:
##########
@@ -259,7 +259,13 @@ def visit_customized(self, field_name, type_,
types_path=None):
if typeinfo is not None:
hash_value = typeinfo.type_id
if TypeId.is_namespaced_type(typeinfo.type_id):
- hash_value = compute_string_hash(typeinfo.namespace +
typeinfo.typename)
+ namespace_str = typeinfo.namespace_bytes.decode(
+ self.fory.type_resolver._resolver.namespace_decoder
Review Comment:
> how about making `namespace_decoder` and `typename_decoder` as a
module-level variable, and create `decode_namespace/decode_typename` method in
`TypeInfo`? We could import those decoders in the created functions
> how about making `namespace_decoder` and `typename_decoder` as a
module-level variable, and create `decode_namespace/decode_typename` method in
`TypeInfo`? We could import those decoders in the created functions
Sir, I’ve implemented the two decoders as module-level variables according
to my understanding—please feel free to point out anything that may be
inappropriate. I’m just concerned I might have misunderstood, as while
rewriting the code I kept wondering if I should have moved MetaStringDecoder
from the Python implementation into the Cython layer.
--
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]