Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion openml/setups/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def setup_exists(flow) -> int:
# checks whether the flow exists on the server and flow ids align
exists = flow_exists(flow.name, flow.external_version)
if exists != flow.flow_id:
raise ValueError("This should not happen!")
raise ValueError(
f"Local flow id ({flow.id}) differs from server id ({exists}). "
"If this issue persists, please contact the developers."
)

openml_param_settings = flow.extension.obtain_parameter_values(flow)
description = xmltodict.unparse(_to_dict(flow.flow_id, openml_param_settings), pretty=True)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_runs/test_run_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,13 +1112,13 @@ def test__run_exists(self):

flow = self.extension.model_to_flow(clf)
flow_exists = openml.flows.flow_exists(flow.name, flow.external_version)
self.assertGreater(flow_exists, 0)
self.assertGreater(flow_exists, 0, "Server says flow from run does not exist.")
# Do NOT use get_flow reinitialization, this potentially sets
# hyperparameter values wrong. Rather use the local model.
downloaded_flow = openml.flows.get_flow(flow_exists)
downloaded_flow.model = clf
setup_exists = openml.setups.setup_exists(downloaded_flow)
self.assertGreater(setup_exists, 0)
self.assertGreater(setup_exists, 0, "Server says setup of run does not exist.")
run_ids = run_exists(task.task_id, setup_exists)
self.assertTrue(run_ids, msg=(run_ids, clf))

Expand Down