Skip to content

Commit

Permalink
Conditionally remove modified column
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Ringer <jringer@anduril.com>
  • Loading branch information
jonringer committed Sep 30, 2024
1 parent ab5e04d commit f22570a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sbomnix/sbomdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ def to_cdx(self, cdx_path, printinfo=True):
[scanner.df_grype, scanner.df_osv, scanner.df_vulnix],
ignore_index=True,
)
# Concat adds a modified column, remove
vulns.drop("modified", axis=1, inplace=True)
# Concat adds a modified column, remove as it will invalidate groupby logic
if "modified" in vulns.columns:
vulns.drop("modified", axis=1, inplace=True)
# Deduplicate repeated vulnerabilities, making the scanner column into an array
vuln_grouped = vulns.groupby(
["package", "version", "severity", "vuln_id"],
Expand Down

0 comments on commit f22570a

Please sign in to comment.