How to use the pyexasol.callback.export_to_pandas function in pyexasol

To help you get started, we’ve selected a few pyexasol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github badoo / pyexasol / examples / 14_parallel_export.py View on Github external
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)}")
github badoo / pyexasol / examples / 21_parallel_export_import.py View on Github external
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)}")
github badoo / pyexasol / pyexasol / connection.py View on Github external
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)