Skip to content

Commit f3873e7

Browse files
committed
modification in parameter_extractor to accommodate new parameters.json file
1 parent 78683c8 commit f3873e7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

benchmarks/common/parameter_extractor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ def extract_params(self, rule_name: str, file_path: str) -> dict:
2323
with open(file_path) as f:
2424
data = json.load(f)
2525
for key, val in data.items():
26-
if isinstance(val, dict):
26+
if isinstance(val, dict) and "value" in val:
2727
results[rule_name]["has parameter"].append({key: {
2828
"value": val["value"],
29-
"unit": f"{val["unit"]}" if "unit" in val else None,
29+
"unit": f"{val['unit']}" if "unit" in val else None,
3030
"json-path": f"/{key}/value",
3131
"data-type": self._get_type(val["value"]),
3232
}})

0 commit comments

Comments
 (0)