ogert лет назад: 4
Родитель
Сommit
6a1f801bd9
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      cdplib/db_handlers/MongodbHandler.py

+ 3 - 3
cdplib/db_handlers/MongodbHandler.py

@@ -110,8 +110,8 @@ class MongodbHandler:
             "Parameter 'collection_name' must be a string type"
         assert(isinstance(key, str) and key in allowed_directions),\
             "Parameter 'key' must be a string type and must be one of these values: 1, -1, '2d', 'geoHaystack', '2dsphere', 'hashed', 'text' "
-        assert(isinstance(validation_level, str)),\
-            "Parameter 'validdirectionation_lever' must be a string type"
+        assert(isinstance(direction, str)),\
+            "Parameter 'direction' must be a string type"
             
         self._database[collection_name].create_index([key, direction])
 
@@ -262,7 +262,7 @@ class MongodbHandler:
             else:
                 self._log.warning(('No data for the query was found').format())
         except Exception as error:
-            self._log.log_and_raise_error(('An error occured trying to convert mongo data into pd.Dataframe. \nError: {} ').format(errors))
+            self._log.log_and_raise_error(('An error occured trying to convert mongo data into pd.Dataframe. \nError: {} ').format(error))
 
     def update_data_in_collection(self, query_label: str, query_value: str, update_label:str, update_value: str, collection_name:str):
         self._database[collection_name].update_one({query_label:query_value}, {"$set": {update_label: update_value}})