Bladeren bron

update cdplib

tsteuer 5 jaren geleden
bovenliggende
commit
b2a5819d6c
2 gewijzigde bestanden met toevoegingen van 6 en 6 verwijderingen
  1. 6 5
      cdplib/db_handlers/MongodbHandler.py
  2. 0 1
      cdplib/db_migration/ParseJsonSchema.py

+ 6 - 5
cdplib/db_handlers/MongodbHandler.py

@@ -9,20 +9,19 @@ Created on Mon Sep 16 13:27:44 2019
 """
 
 
-import json
+
 import simplejson
 import sys
 import os
-import jsonref
 
-from copy import deepcopy
+
 from pymongo import MongoClient
 import pandas as pd
 import numpy as np
 
 sys.path.append(os.getcwd())
 from cdplib.log import Log
-from cdplib.Singleton_Threadsafe import SingletonThreadsafe
+from cdplib.db_migration.ParseJsonSchema import ParseJsonSchema
 
 
 #class MongodbHandlerPool(metaclass=SingletonThreadsafe):
@@ -115,8 +114,10 @@ class MongodbHandler:
             "Parameter 'validation_lever' must be a string type"
         assert(isinstance(validation_action, str)),\
             "Parameter 'validation_action' must be a string type"
+            
+        parse_obj = ParseJsonSchema()
 
-        schema = self._read_schema(schema_path)
+        schema = parse_obj.read_schema_and_parse_for_mongodb(schema_path)
 
         command = {
                     'collMod': collection_name,

+ 0 - 1
cdplib/db_migration/ParseJsonSchema.py

@@ -14,7 +14,6 @@ import json
 
 import jsonref
 from pathlib import Path
-from urllib.parse import urljoin
 
 sys.path.append(os.getcwd())