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

Function utf8_encode_if_needed

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

Source from the content-addressed store, hash-verified

116
117# Helper to decode unicode to utf8 encoded str in Python 2. NOOP in Python 3.
118def utf8_encode_if_needed(val):
119 if sys.version_info.major < 3 and isinstance(val, unicode): # noqa: F821
120 val = val.encode('utf-8', errors='replace')
121 return val
122
123
124def get_ssl_context(ca_cert, verify_cert):

Callers 7

test_binary_displayMethod · 0.90
test_unicode_inputMethod · 0.90
_create_query_reqMethod · 0.85
_create_query_reqMethod · 0.85
_do_beeswax_rpcMethod · 0.85

Calls 1

encodeMethod · 0.80

Tested by 2

test_binary_displayMethod · 0.72
test_unicode_inputMethod · 0.72