Skip to content

Commit d1c6458

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f69cca5 commit d1c6458

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

openml/study/functions.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def _get_study(id_: int | str, entity_type: str) -> BaseStudy:
9090
)
9191
result_dict = xmltodict.parse(xml_string, force_list=force_list_tags)["oml:study"]
9292
study_id = int(result_dict["oml:id"])
93-
alias = result_dict["oml:alias"] if "oml:alias" in result_dict else None
93+
alias = result_dict.get("oml:alias", None)
9494
main_entity_type = result_dict["oml:main_entity_type"]
9595

9696
if entity_type != main_entity_type:
@@ -99,9 +99,7 @@ def _get_study(id_: int | str, entity_type: str) -> BaseStudy:
9999
f", expected '{entity_type}'"
100100
)
101101

102-
benchmark_suite = (
103-
result_dict["oml:benchmark_suite"] if "oml:benchmark_suite" in result_dict else None
104-
)
102+
benchmark_suite = result_dict.get("oml:benchmark_suite", None)
105103
name = result_dict["oml:name"]
106104
description = result_dict["oml:description"]
107105
status = result_dict["oml:status"]

0 commit comments

Comments
 (0)