Skip to content

Commit

Permalink
Cyberint risk key none value (#832)
Browse files Browse the repository at this point in the history
* Cyberint risk key none value

* Workaround for bug in panel

* Fixing typo in data_viewer_panel

---------

Co-authored-by: Meroujan.Antonyan <[email protected]>
Co-authored-by: ianhelle <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2025
1 parent a4b0b72 commit c14a2da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 3 additions & 1 deletion msticpy/context/tiproviders/cyberint.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def parse_results(self: Self, response: dict) -> tuple[bool, ResultSeverity, Any

data: dict[str, Any] = response["RawResult"].get("data", {})

score: int = (data.get("risk", {})).get("malicious_score", 0)
score: int = 0
if data.get("risk"):
score = (data.get("risk", {})).get("malicious_score", 0)

if score > self.HIGH_SEVERITY:
result_severity = ResultSeverity.high
Expand Down
19 changes: 14 additions & 5 deletions msticpy/vis/data_viewer_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Any, Callable, Dict, Iterable, List, Optional

import pandas as pd
from IPython import get_ipython
from IPython.display import display

from ..common.exceptions import MsticpyMissingDependencyError
Expand Down Expand Up @@ -74,11 +75,19 @@ def __init__(self, data: pd.DataFrame, selected_cols: List[str] = None, **kwargs
"""
if not pn.extension._loaded:
pn.extension(
"tabulator",
sizing_mode="stretch_width",
css_files=[pn.io.resources.CSS_URLS["font-awesome"]],
)
try:
pn.extension(
"tabulator",
sizing_mode="stretch_width",
css_files=[pn.io.resources.CSS_URLS["font-awesome"]],
)
except NameError:
pn.extension(
"tabulator",
sizing_mode="stretch_width",
css_files=[pn.io.resources.CSS_URLS["font-awesome"]],
ip=get_ipython(),
)
if data.empty:
raise ValueError("No data available in 'data'")

Expand Down

0 comments on commit c14a2da

Please sign in to comment.