MCPcopy Create free account
hub / github.com/apache/thrift / readContainerMap

Method readContainerMap

lib/py/src/protocol/TProtocol.py:308–318  ·  view source on GitHub ↗
(self, spec)

Source from the content-addressed store, hash-verified

306 return obj
307
308 def readContainerMap(self, spec):
309 ktype, kspec, vtype, vspec, is_immutable = spec
310 (map_ktype, map_vtype, map_len) = self.readMapBegin()
311 # TODO: compare types we just decoded with thrift_spec and
312 # abort/skip if types disagree
313 keys = self._read_by_ttype(ktype, spec, kspec)
314 vals = self._read_by_ttype(vtype, spec, vspec)
315 keyvals = islice(zip(keys, vals), map_len)
316 results = (TFrozenDict if is_immutable else dict)(keyvals)
317 self.readMapEnd()
318 return results
319
320 def readStruct(self, obj, thrift_spec, is_immutable=False):
321 if is_immutable:

Callers

nothing calls this directly

Calls 3

readMapBeginMethod · 0.95
_read_by_ttypeMethod · 0.95
readMapEndMethod · 0.95

Tested by

no test coverage detected