Skip to content

Commit c3d3e0c

Browse files
committed
chore: remove log statements that have no value or can cause crashes/noisy logs
1 parent e8f8bc9 commit c3d3e0c

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/pyflask/curate/curate.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -907,10 +907,7 @@ def recursive_dataset_scan(
907907
list_copy_files, list_move_files = recursive_dataset_scan(
908908
folder, folderpath, list_copy_files, list_move_files
909909
)
910-
for file in list_copy_files:
911-
namespace_logger.info(f"file to copy: {file}")
912-
for file in list_move_files:
913-
namespace_logger.info(f"file to move: {file}")
910+
914911
# 3. Add high-level metadata files in the list
915912
if "metadata-files" in soda_json_structure.keys():
916913
namespace_logger.info("generate_dataset_locally (optional) step 3 handling metadata-files")

src/pyflask/datasets/compare_local_remote_files.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
def import_subfolders(subfolder, path):
1818
global PENNSIEVE_URL
19+
global namespace_logger
1920
global pennsieve_dataset_paths
2021
folder_id = subfolder["id"]
2122
try:
@@ -38,7 +39,7 @@ def import_subfolders(subfolder, path):
3839
for folder_name, folder in subfolder["folders"].items():
3940
import_subfolders(folder, f"{path}/{folder_name}")
4041
except Exception as e:
41-
print(f"Exception when calling API: {e}")
42+
namespace_logger.info(f"Exception when calling API: {e}")
4243
raise e
4344

4445

@@ -72,7 +73,7 @@ def import_pennsieve_dataset(dataset_id, path):
7273
for folder_name, folder in pennsieve_dataset_structure["folders"].items():
7374
import_subfolders(folder, f"{folder_name}")
7475
except Exception as e:
75-
print(f"Exception when calling API: {e}")
76+
namespace_logger.info(f"Exception when calling API: {e}")
7677
raise e
7778

7879

@@ -100,7 +101,7 @@ def import_local_dataset(path):
100101
for folder_name, folder in local_dataset_structure["folders"].items():
101102
import_local_subfolders(folder, f"{path}/{folder_name}")
102103
except Exception as e:
103-
print(f"Exception when calling API: {e}")
104+
namespace_logger.info(f"Exception when calling API: {e}")
104105
raise e
105106

106107

@@ -125,7 +126,7 @@ def import_local_subfolders(subfolder, path):
125126
for folder_name, folder in subfolder["folders"].items():
126127
import_local_subfolders(folder, f"{path}/{folder_name}")
127128
except Exception as e:
128-
print(f"Exception when calling API: {e}")
129+
namespace_logger.info(f"Exception when calling API: {e}")
129130
raise e
130131

131132

src/pyflask/datasets/datasets.py

-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ def reserve_dataset_doi(dataset): # sourcery skip: extract-method
132132
doi_request.raise_for_status()
133133
return {"doi": doi_request.json()["doi"]}
134134
except Exception as e:
135-
print(e)
136135
abort(e.response.status_code, e.response.json().get('message'))
137136

138137

0 commit comments

Comments
 (0)