Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run(self):
self.read_pipe.close()
http = pyexasol.http_transport(self.node['host'], self.node['port'], pyexasol.HTTP_EXPORT)
self.write_pipe.send(http.get_proxy())
self.write_pipe.close()
pd = http.export_to_callback(cb.export_to_pandas, None)
print(f"{self.node['idx']}:{len(pd)}")
def run(self):
self.read_pipe.close()
http_export = pyexasol.http_transport(self.node['host'], self.node['port'], pyexasol.HTTP_EXPORT, compression=True, encryption=True)
http_import = pyexasol.http_transport(self.node['host'], self.node['port'], pyexasol.HTTP_IMPORT, compression=True, encryption=True)
# Send list of proxy strings, one element per HTTP transport instance
self.write_pipe.send([http_export.get_proxy(), http_import.get_proxy()])
self.write_pipe.close()
pd = http_export.export_to_callback(cb.export_to_pandas, None)
print(f"EXPORT shard_id:{self.node['idx']}, affected_rows:{len(pd)}")
http_import.import_from_callback(cb.import_from_pandas, pd)
print(f"IMPORT shard_id:{self.node['idx']}, affected_rows:{len(pd)}")
def export_to_pandas(self, query_or_table, query_params=None, callback_params=None, export_params=None):
if not export_params:
export_params = {}
export_params['with_column_names'] = True
return self.export_to_callback(cb.export_to_pandas, None, query_or_table, query_params, callback_params, export_params)