diff --git a/genie/process_mutation.py b/genie/process_mutation.py index b2846ffd..fe27d647 100644 --- a/genie/process_mutation.py +++ b/genie/process_mutation.py @@ -342,6 +342,7 @@ def check_annotation_error_reports( maf_table_synid (str): synapse_id of the narrow maf table full_error_report (pd.DataFrame): the failed annotations error report center (str): the center this is for + """ maf_table_df = extract.get_syntabledf( syn=syn, @@ -351,10 +352,11 @@ def check_annotation_error_reports( "Annotation_Status = 'FAILED'" ), ) - assert len(maf_table_df) == len(full_error_report), ( - "Genome nexus's failed annotations error report rows doesn't match" - f"maf table's failed annotations for {center}" - ) + if len(maf_table_df) != len(full_error_report): + logger.warning( + "Genome nexus's failed annotations error report rows doesn't match" + f"maf table's failed annotations for {center}" + ) def store_annotation_error_reports( diff --git a/tests/test_process_mutation.py b/tests/test_process_mutation.py index 5895dee3..94e03d3f 100644 --- a/tests/test_process_mutation.py +++ b/tests/test_process_mutation.py @@ -264,25 +264,26 @@ def test_check_annotation_error_reports_passes_if_match( "Annotation_Status = 'FAILED'", ) - def test_check_annotation_error_reports_throws_assertion_if_no_match( - self, syn, test_error_report + def test_check_annotation_error_reports_raises_warning_if_no_match( + self, syn, test_error_report, caplog ): with patch.object( extract, "get_syntabledf", return_value=pd.DataFrame({"test": [1], "test2": [2]}), ): - with pytest.raises( - AssertionError, - match="Genome nexus's failed annotations error report rows doesn't match" - "maf table's failed annotations for SAGE", - ): - process_mutation.check_annotation_error_reports( - syn=syn, - maf_table_synid="synZZZZ", - full_error_report=test_error_report, - center="SAGE", - ) + process_mutation.check_annotation_error_reports( + syn=syn, + maf_table_synid="synZZZZ", + full_error_report=test_error_report, + center="SAGE", + ) + assert ( + "Genome nexus's failed annotations error report rows doesn't match" + "maf table's failed annotations for SAGE" in caplog.text + ) + # check that at least one is a warning + assert any(record.levelname == "WARNING" for record in caplog.records) def test_concat_annotation_error_reports_returns_expected(self, test_error_report): compiled_report = process_mutation.concat_annotation_error_reports(