@@ -68,7 +68,7 @@ class RiskFactor(BaseExportedEntity):
6868 **Example**: `Device Supports SMBv1`
6969 """
7070
71- score : int
71+ score : Optional [ int ]
7272 """The score of the risk factor"""
7373
7474 group : str
@@ -78,14 +78,14 @@ class RiskFactor(BaseExportedEntity):
7878 **Example**: `INSECURE_TRAFFIC_AND_BEHAVIOR`
7979 """
8080
81- remediation_type : str
81+ remediation_type : Optional [ str ]
8282 """
8383 The type of the remediation
8484
8585 **Example**: `Disable SMBv1 Protocol`
8686 """
8787
88- remediation_description : str
88+ remediation_description : Optional [ str ]
8989 """
9090 The description of the remediation
9191
@@ -130,15 +130,27 @@ def series_to_model(cls, series: pandas.Series) -> "RiskFactor":
130130 category = series .loc ["category" ],
131131 type = series .loc ["type" ],
132132 description = series .loc ["description" ],
133- score = series .loc ["score" ],
133+ score = (
134+ int (score )
135+ if (score := cls ._value_or_none (series .loc ["score" ]))
136+ else None
137+ ),
134138 status = series .loc ["status" ],
135139 group = series .loc ["group" ],
136- remediation_type = series .loc ["remediation" ],
137- remediation_description = series .loc ["remediation_description" ],
138- remediation_recommended_actions = [
139- RiskFactorRecommendedAction (** item )
140- for item in json .loads (series .loc ["remediation_recommended_actions" ])
141- ],
140+ remediation_type = cls ._value_or_none (series .loc ["remediation" ]),
141+ remediation_description = cls ._value_or_none (
142+ series .loc ["remediation_description" ]
143+ ),
144+ remediation_recommended_actions = (
145+ [
146+ RiskFactorRecommendedAction (** item )
147+ for item in json .loads (
148+ series .loc ["remediation_recommended_actions" ]
149+ )
150+ ]
151+ if series .loc ["remediation_recommended_actions" ]
152+ else []
153+ ),
142154 first_seen = series .loc ["first_seen" ].to_pydatetime (),
143155 last_seen = series .loc ["last_seen" ].to_pydatetime (),
144156 status_update_time = cls ._value_or_none (series .loc ["status_update_time" ]),
0 commit comments