From 5a73a98619fe1f99027a6b77da8fae02850a3f6d Mon Sep 17 00:00:00 2001 From: alesapin Date: Fri, 22 Feb 2019 15:13:55 +0300 Subject: [PATCH] Remove pymongo --- .../external_sources.py | 70 +++++++++---------- .../test_external_dictionaries/test.py | 2 + 2 files changed, 37 insertions(+), 35 deletions(-) diff --git a/dbms/tests/integration/test_external_dictionaries/external_sources.py b/dbms/tests/integration/test_external_dictionaries/external_sources.py index 251e85b852..030d32f7e5 100644 --- a/dbms/tests/integration/test_external_dictionaries/external_sources.py +++ b/dbms/tests/integration/test_external_dictionaries/external_sources.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import warnings import pymysql.cursors -import pymongo +#import pymongo import os @@ -123,40 +123,40 @@ class SourceMySQL(ExternalSource): self.execute_mysql_query(query) -class SourceMongo(ExternalSource): - - def get_source_str(self, table_name): - return ''' - - {host} - {port} - {user} - {password} - test - {tbl} - - '''.format( - host=self.docker_hostname, - port=self.docker_port, - user=self.user, - password=self.password, - tbl=table_name, - ) - - def prepare(self, structure, table_name, cluster): - connection_str = 'mongodb://{user}:{password}@{host}:{port}'.format( - host=self.internal_hostname, port=self.internal_port, - user=self.user, password=self.password) - self.connection = pymongo.MongoClient(connection_str) - self.connection.create - self.structure = structure - self.db = self.connection['test'] - self.prepared = True - - def load_data(self, data, table_name): - tbl = self.db[table_name] - to_insert = [dict(row.data) for row in data] - result = tbl.insert_many(to_insert) +#class SourceMongo(ExternalSource): +# +# def get_source_str(self, table_name): +# return ''' +# +# {host} +# {port} +# {user} +# {password} +# test +# {tbl} +# +# '''.format( +# host=self.docker_hostname, +# port=self.docker_port, +# user=self.user, +# password=self.password, +# tbl=table_name, +# ) +# +# def prepare(self, structure, table_name, cluster): +# connection_str = 'mongodb://{user}:{password}@{host}:{port}'.format( +# host=self.internal_hostname, port=self.internal_port, +# user=self.user, password=self.password) +# self.connection = pymongo.MongoClient(connection_str) +# self.connection.create +# self.structure = structure +# self.db = self.connection['test'] +# self.prepared = True +# +# def load_data(self, data, table_name): +# tbl = self.db[table_name] +# to_insert = [dict(row.data) for row in data] +# result = tbl.insert_many(to_insert) class SourceClickHouse(ExternalSource): diff --git a/dbms/tests/integration/test_external_dictionaries/test.py b/dbms/tests/integration/test_external_dictionaries/test.py index 5a15fc8b72..11b93e9874 100644 --- a/dbms/tests/integration/test_external_dictionaries/test.py +++ b/dbms/tests/integration/test_external_dictionaries/test.py @@ -151,6 +151,7 @@ def test_simple_dictionaries(started_cluster): dct.load_data(data) node.query("system reload dictionaries") + queries_with_answers = [] for dct in simple_dicts: for row in data: @@ -183,6 +184,7 @@ def test_complex_dictionaries(started_cluster): dct.load_data(data) node.query("system reload dictionaries") + queries_with_answers = [] for dct in complex_dicts: for row in data: -- GitLab