From 8ad69a503bc1d10ab37191dba25067f47f2fc362 Mon Sep 17 00:00:00 2001 From: Michael Hohn Date: Thu, 11 Aug 2022 16:26:07 -0700 Subject: [PATCH] Reduce zero results from error to warning --- sarif_cli/scan_tables.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sarif_cli/scan_tables.py b/sarif_cli/scan_tables.py index d3fe23e..6a924a5 100644 --- a/sarif_cli/scan_tables.py +++ b/sarif_cli/scan_tables.py @@ -1,11 +1,13 @@ """ Collection of joins for the derived tables """ -import pandas as pd -import numpy -import re from . import snowflake_id +import logging +import numpy +import pandas as pd +import re + class ZeroResults(Exception): pass @@ -153,10 +155,9 @@ def joins_for_results(basetables, external_info): res = pd.concat(stack) else: if stack == []: - # Sanity check: The case of zero results must be handled at - # sarif read time and should never reach here. - raise ZeroResults("Zero problem/path_problem results found in sarif " - "file but processing anyway. Internal error.") + # TODO: The case of zero results should be handled at sarif read time + logging.warning("Zero problem/path_problem results found in sarif " + "file but processing anyway.") res = tables[0] # Force all column types to ensure appropriate formatting