From 9500075c21908d3849b08b68bce9034a5c9ef8aa Mon Sep 17 00:00:00 2001 From: Assaf Ben-David Date: Fri, 7 Apr 2023 15:04:09 -0400 Subject: [PATCH] Fixed completeness check for zero expected lines --- observe_export/observe_export.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/observe_export/observe_export.py b/observe_export/observe_export.py index aa3a053..7aa53fa 100644 --- a/observe_export/observe_export.py +++ b/observe_export/observe_export.py @@ -585,9 +585,9 @@ def get_crawling_command(start_time: datetime, end_time: datetime, output_file: f"Was expecting to find exactly one csv file with the correctness data but found multiple: {files_downloaded}") correctness_file = files_downloaded[0] if crawling_format == Format.CSV: - expected_number_of_lines = pd.read_csv(correctness_file, header=0)["count"][0] + expected_number_of_lines = pd.read_csv(correctness_file, header=0)["count"].get(0, 0) else: - expected_number_of_lines = pd.read_json(correctness_file, lines=True)["count"][0] + expected_number_of_lines = pd.read_json(correctness_file, lines=True)["count"].get(0, 0) _, number_of_lines_exported = get_first_line_and_line_count(main_result_file) if expected_number_of_lines == number_of_lines_exported: print("\tCompleteness check passed!\n\t\t all rows were exported!")