MCPcopy Create free account
hub / github.com/apache/fory / _read_typing_union

Method _read_typing_union

python/pyfory/union.py:192–197  ·  view source on GitHub ↗
(self, read_context)

Source from the content-addressed store, hash-verified

190 active_serializer.write(write_context, value)
191
192 def _read_typing_union(self, read_context):
193 stored_index = read_context.read_var_uint32()
194 if stored_index >= len(self._alternative_serializers):
195 raise ValueError(f"Union index out of bounds: {stored_index} (max: {len(self._alternative_serializers) - 1})")
196 typeinfo = self.type_resolver.read_type_info(read_context)
197 return typeinfo.serializer.read(read_context)

Callers 1

readMethod · 0.95

Calls 3

readMethod · 0.65
read_var_uint32Method · 0.45
read_type_infoMethod · 0.45

Tested by

no test coverage detected