Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: roll back change to work with older and newer xmltodict versions
  • Loading branch information
LennartPurucker committed Oct 16, 2024
commit edcecedf72768af9f3e5353ef4ac305ac2ad16d9
8 changes: 1 addition & 7 deletions openml/study/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_study(
return study


def _get_study(id_: int | str, entity_type: str) -> BaseStudy: # noqa: C901
def _get_study(id_: int | str, entity_type: str) -> BaseStudy:
xml_string = openml._api_calls._perform_api_call(f"study/{id_}", "get")
force_list_tags = (
"oml:data_id",
Expand All @@ -93,12 +93,6 @@ def _get_study(id_: int | str, entity_type: str) -> BaseStudy: # noqa: C901
alias = result_dict.get("oml:alias", None)
main_entity_type = result_dict["oml:main_entity_type"]

# Parses edge cases where the server returns a string with a newline character for empty values.
none_value_indicator = "\n "
for key in result_dict:
if result_dict[key] == none_value_indicator:
result_dict[key] = None

if entity_type != main_entity_type:
raise ValueError(
f"Unexpected entity type '{main_entity_type}' reported by the server"
Expand Down