16
16
17
17
def import_subfolders (subfolder , path ):
18
18
global PENNSIEVE_URL
19
+ global namespace_logger
19
20
global pennsieve_dataset_paths
20
21
folder_id = subfolder ["id" ]
21
22
try :
@@ -38,7 +39,7 @@ def import_subfolders(subfolder, path):
38
39
for folder_name , folder in subfolder ["folders" ].items ():
39
40
import_subfolders (folder , f"{ path } /{ folder_name } " )
40
41
except Exception as e :
41
- print (f"Exception when calling API: { e } " )
42
+ namespace_logger . info (f"Exception when calling API: { e } " )
42
43
raise e
43
44
44
45
@@ -72,7 +73,7 @@ def import_pennsieve_dataset(dataset_id, path):
72
73
for folder_name , folder in pennsieve_dataset_structure ["folders" ].items ():
73
74
import_subfolders (folder , f"{ folder_name } " )
74
75
except Exception as e :
75
- print (f"Exception when calling API: { e } " )
76
+ namespace_logger . info (f"Exception when calling API: { e } " )
76
77
raise e
77
78
78
79
@@ -100,7 +101,7 @@ def import_local_dataset(path):
100
101
for folder_name , folder in local_dataset_structure ["folders" ].items ():
101
102
import_local_subfolders (folder , f"{ path } /{ folder_name } " )
102
103
except Exception as e :
103
- print (f"Exception when calling API: { e } " )
104
+ namespace_logger . info (f"Exception when calling API: { e } " )
104
105
raise e
105
106
106
107
@@ -125,7 +126,7 @@ def import_local_subfolders(subfolder, path):
125
126
for folder_name , folder in subfolder ["folders" ].items ():
126
127
import_local_subfolders (folder , f"{ path } /{ folder_name } " )
127
128
except Exception as e :
128
- print (f"Exception when calling API: { e } " )
129
+ namespace_logger . info (f"Exception when calling API: { e } " )
129
130
raise e
130
131
131
132
0 commit comments