Skip to content

Commit 080edf3

Browse files
committed
Add warning for empty extraction and update test join
Extractor now logs a warning if no dataframes are extracted. Updated test to use 's4h_join_data' instead of 'join_data' for merging filtered dataframes.
1 parent 2802382 commit 080edf3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/socio4health/extractor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ def s4h_extract(self):
180180
logging.error(f"Exception while extracting data: {e}")
181181
raise ValueError(f"Extraction failed: {str(e)}")
182182

183+
if not self.dataframes:
184+
logging.warning("No data was extracted. The extraction process returned an empty result.")
185+
183186
return self.dataframes
184187

185188
def _extract_online_mode(self):

tests/mytest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test():
124124

125125
"""
126126
print('Horizontal merge___________________________________')
127-
joined_df = har.join_data(filtered_ddfs)
127+
joined_df = har.s4h_join_data(filtered_ddfs)
128128
available_cols = joined_df.columns.tolist()
129129
130130
print(f"Available columns: {available_cols}")

0 commit comments

Comments
 (0)