From 237f99bd7278fdaa9a301eaa82364e32d6debca0 Mon Sep 17 00:00:00 2001 From: Vishal Anand <101251245+vishale6x@users.noreply.github.com> Date: Sat, 3 Jun 2023 12:08:06 +0530 Subject: [PATCH] Query strip added. --- README.md | 2 +- e6xdb/e6x.py | 43 +------------------------------------------ setup.py | 2 +- 3 files changed, 3 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index c69f44d..bf28b71 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # e6data Python Connector -![version](https://img.shields.io/badge/version-1.0.7-blue.svg) +![version](https://img.shields.io/badge/version-1.0.8-blue.svg) ## Introduction diff --git a/e6xdb/e6x.py b/e6xdb/e6x.py index 2d5feb2..ffcf971 100644 --- a/e6xdb/e6x.py +++ b/e6xdb/e6x.py @@ -365,6 +365,7 @@ def execute(self, operation, parameters=None, **kwargs): """ Semicolon is now not supported. So removing it from query end. """ + operation = operation.strip() if operation.endswith(';'): operation = operation[:-1] @@ -516,45 +517,3 @@ class Error(Exception): for type_id in PRIMITIVE_TYPES: name = TypeId._VALUES_TO_NAMES[type_id] setattr(sys.modules[__name__], name, DBAPITypeObject([name])) - - -if __name__ == '__main__': - ip = '54.205.255.188' - conn = Connection( - host=ip, - username='admin', - password='admin', - port=9000 - ) - catalogs = {'catalogs': [{ - "type": 'HIVE', - "name": 'hive', - "hive_ip": '18.233.112.169', - "hive_port": 9084, - "included_schemas": [], - "excluded_schemas": [], - "included_tables": [], - "excluded_tables": [], - "included_columns": [], - "excluded_columns": [], - "is_assumed_role": False, - "assumed_role_arn": '', - "default": True - }]} - import json - import time - start = time.time() - # print(conn.add_catalogs(json.dumps(catalogs))) - add_cat_time = time.time() - print('Add catalog time', add_cat_time - start) - status = 'in_progress' - res = conn.get_add_catalog_response() - print(res) - print(res.failures[0].reason) - # while status == 'in_progress': - # res = conn.get_add_catalog_response() - # status = res.status - # print(res) - # time.sleep(5) - print('get_add_catalog_response time', time.time() - add_cat_time) - diff --git a/setup.py b/setup.py index 19eca19..2cd8caf 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ envstring = lambda var: os.environ.get(var) or "" -VERSION = [1, 0, 7] +VERSION = [1, 0, 8] def get_long_desc():