Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def sql_execute(self, query):
self.register()
columnar = True
if self.debug:
print(' %s;' % (query))
result = self.thrift_call(
'sql_execute', self.session_id, query, columnar, "", -1, -1)
descr = _extract_description(result.row_set.row_desc)
return descr, make_row_results_set(result)
"""
# https://github.com/omnisci/pymapd/issues/263
operation = operation.strip()
if parameters is not None:
operation = str(_bind_parameters(operation, parameters))
self.rowcount = -1
try:
result = self.connection._client.sql_execute(
self.connection._session, operation,
column_format=True,
nonce=None, first_n=-1, at_most_n=-1)
except T.TMapDException as e:
raise _translate_exception(e) from e
self._description = _extract_description(result.row_set.row_desc)
try:
self.rowcount = len(result.row_set.columns[0].nulls)
except IndexError:
pass
self._result_set = make_row_results_set(result)
self._result = result
return self