Parcourir la source

Update preprocessing

Ali Bellamine il y a 2 ans
Parent
commit
2a7b105b14
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      bop_scripts/preprocessing.py

+ 3 - 1
bop_scripts/preprocessing.py

@@ -164,7 +164,9 @@ def generate_labels_dataset(database, lab_dictionnary):
     lab_dictionnary_list = [str(x) for x in lab_dictionnary.keys()]
 
     ## Let's create an index to speed up queries
-    conn.execute("CREATE INDEX IF NOT EXISTS biological_index ON labevents (stay_id, itemid)")
+    curs = conn.cursor()
+    curs.execute("CREATE INDEX IF NOT EXISTS biological_index ON labevents (stay_id, itemid)")
+    curs.close()
 
     # 1. Generating features