tanja 4 роки тому
батько
коміт
d5866c70a9

+ 4 - 4
cdplib/db_handlers/MongodbHandler.py

@@ -103,7 +103,7 @@ class MongodbHandler:
             self._client.drop_database(self._database_name)
         except Exception as error:
             self._log.log_and_raise_error(('Couldnt drop the database. Error: {}').format(error))
-    
+
 
     def drop_collection(self, collection_name: str):
         '''
@@ -114,7 +114,7 @@ class MongodbHandler:
                 self._log.warning(('Couldnt drop the collection {}. Error: {}').format(collection_name, return_message['errmsg']))
         except Exception as error:
             self._log.log_and_raise_error(('Couldnt drop the collection {}. Error: {}').format(collection_name, error))
-    
+
     def create_index(self, collection_name: str, key: str, direction: (str, int)='text'):
         '''
         :param str collection_name: name on the collection for which the schema will be set.
@@ -132,7 +132,7 @@ class MongodbHandler:
             "Parameter 'key' must be one of these values: 1, -1, '2d', 'geoHaystack', '2dsphere', 'hashed', 'text' "
         assert(isinstance(direction, str)),\
             "Parameter 'direction' must be a string type"
-            
+
         self._database[collection_name].create_index([(key, direction)], name=key)
         #collection.create_index([('field_i_want_to_index', pymongo.TEXT)], name='search_index', default_language='english')
 
@@ -152,7 +152,7 @@ class MongodbHandler:
             "Parameter 'validation_level' must be a string type"
         assert(isinstance(validation_action, str)),\
             "Parameter 'validation_action' must be a string type"
-            
+
         parse_obj = ParseJsonSchema(schema_paths=schema_path)
 
         schema = parse_obj.read_schema_and_parse_for_mongodb(schema_path)

+ 3 - 2
cdplib/db_migration/ParseJsonSchema.py

@@ -373,8 +373,9 @@ class ParseJsonSchema(ParseDbSchema):
 
         definitions_flag = self._analyze_schema(schema)
 
-        if definitions_flag:
-            schema = self._dereference_schema(schema_path)
+        print("Definitions flag", definitions_flag)
+        # if definitions_flag:
+        schema = self._dereference_schema(schema_path)
 
         return schema