Skip to content

Commit c14a2da

Browse files
vx3rMeroujan.Antonyanianhelle
authored
Cyberint risk key none value (#832)
* Cyberint risk key none value * Workaround for bug in panel * Fixing typo in data_viewer_panel --------- Co-authored-by: Meroujan.Antonyan <meroujan.antonyan.external@axa.com> Co-authored-by: ianhelle <ianhelle@microsoft.com>
1 parent a4b0b72 commit c14a2da

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

msticpy/context/tiproviders/cyberint.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ def parse_results(self: Self, response: dict) -> tuple[bool, ResultSeverity, Any
100100

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

103-
score: int = (data.get("risk", {})).get("malicious_score", 0)
103+
score: int = 0
104+
if data.get("risk"):
105+
score = (data.get("risk", {})).get("malicious_score", 0)
104106

105107
if score > self.HIGH_SEVERITY:
106108
result_severity = ResultSeverity.high

msticpy/vis/data_viewer_panel.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from typing import Any, Callable, Dict, Iterable, List, Optional
1111

1212
import pandas as pd
13+
from IPython import get_ipython
1314
from IPython.display import display
1415

1516
from ..common.exceptions import MsticpyMissingDependencyError
@@ -74,11 +75,19 @@ def __init__(self, data: pd.DataFrame, selected_cols: List[str] = None, **kwargs
7475
7576
"""
7677
if not pn.extension._loaded:
77-
pn.extension(
78-
"tabulator",
79-
sizing_mode="stretch_width",
80-
css_files=[pn.io.resources.CSS_URLS["font-awesome"]],
81-
)
78+
try:
79+
pn.extension(
80+
"tabulator",
81+
sizing_mode="stretch_width",
82+
css_files=[pn.io.resources.CSS_URLS["font-awesome"]],
83+
)
84+
except NameError:
85+
pn.extension(
86+
"tabulator",
87+
sizing_mode="stretch_width",
88+
css_files=[pn.io.resources.CSS_URLS["font-awesome"]],
89+
ip=get_ipython(),
90+
)
8291
if data.empty:
8392
raise ValueError("No data available in 'data'")
8493

0 commit comments

Comments
 (0)