MCPcopy Create free account
hub / github.com/apache/impala / utf8_decode_if_needed

Function utf8_decode_if_needed

shell/impala_shell/impala_client.py:111–114  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

109
110# Helper to decode utf8 encoded str to unicode type in Python 2. NOOP in Python 3.
111def utf8_decode_if_needed(val):
112 if sys.version_info.major < 3 and isinstance(val, str):
113 val = val.decode('utf-8', errors='replace')
114 return val
115
116
117# Helper to decode unicode to utf8 encoded str in Python 2. NOOP in Python 3.

Callers 4

execute_queryMethod · 0.85

Calls 1

decodeMethod · 0.80

Tested by

no test coverage detected