mirror of
https://github.com/hohn/sarif-cli.git
synced 2025-12-16 17:23:03 +01:00
fix: special concatenation case for empty tables
This commit is contained in:
committed by
=Michael Hohn
parent
32413984e2
commit
fd55969b76
@@ -48,11 +48,17 @@ def joins_for_results(basetables, external_info):
|
||||
# kind_pathproblem
|
||||
#
|
||||
# Concatenation with an empty table triggers type conversion to float, so don't
|
||||
# include empty tables
|
||||
res = pd.concat(
|
||||
[table for table in [_results_from_kind_problem(basetables, external_info),
|
||||
_results_from_kind_pathproblem(basetables, external_info)]
|
||||
if len(table) > 0])
|
||||
# include empty tables.
|
||||
tables = [_results_from_kind_problem(basetables, external_info),
|
||||
_results_from_kind_pathproblem(basetables, external_info)]
|
||||
stack = [table for table in tables if len(table) > 0]
|
||||
|
||||
# Concatenation fails without at least one table, so avoid that.
|
||||
if len(stack) > 0:
|
||||
res = pd.concat(stack)
|
||||
else:
|
||||
res = tables[0]
|
||||
|
||||
return res
|
||||
|
||||
def _results_from_kind_problem(basetables, external_info):
|
||||
|
||||
Reference in New Issue
Block a user