Skip to content

Commit 6421119

Browse files
committed
Add a check if any files remain after filtering
1 parent 6e0aaf6 commit 6421119

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/workbench/core/artifacts/data_capture_core.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ def get_captured_data(self, from_date: str = None, add_timestamp: bool = True) -
231231
self.log.info(f"Processing {len(files)} files from {from_date} onwards.")
232232
else:
233233
self.log.info(f"Processing all {len(files)} files...")
234+
235+
# Check if any files remain after filtering
236+
if not files:
237+
self.log.info(f"No files to process after date filtering.")
238+
return pd.DataFrame(), pd.DataFrame()
239+
240+
# Sort files by name (assumed to include timestamp)
234241
files.sort()
235242

236243
# Get all timestamps in one batch if needed
@@ -337,7 +344,7 @@ def __repr__(self) -> str:
337344
# print(pred_df.head())
338345

339346
# Check that data capture is working
340-
input_df, output_df = dc.get_captured_data()
347+
input_df, output_df = dc.get_captured_data(from_date="2025-09-01")
341348
if input_df.empty and output_df.empty:
342349
print("No data capture files found, for a new endpoint it may take a few minutes to start capturing data")
343350
else:

0 commit comments

Comments
 (0)