Skip to content

Commit 9dd9847

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

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

src/database/runs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,3 @@ def delete(run_id: int, expdb: Connection) -> None:
117117
text("DELETE FROM run WHERE `rid` = :run_id"),
118118
parameters={"run_id": run_id},
119119
)
120-

src/routers/openml/runs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_OML_NAMESPACE = "http://openml.org/openml"
3131

3232

33-
3433
def _parse_run_xml(xml_bytes: bytes) -> dict[str, Any]:
3534
"""Parse the run description XML uploaded by the client.
3635

src/worker/evaluator.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ def _parse_dataset_labels(
106106
return {}
107107

108108
target_idx = attr_names.index(target_attribute)
109-
return {
110-
i: row[target_idx]
111-
for i, row in enumerate(data_rows)
112-
if target_idx < len(row)
113-
}
109+
return {i: row[target_idx] for i, row in enumerate(data_rows) if target_idx < len(row)}
114110

115111

116112
def _evaluate_run(run_id: int, expdb: Connection) -> None: # noqa: C901, PLR0911, PLR0912, PLR0915
@@ -162,9 +158,7 @@ def _evaluate_run(run_id: int, expdb: Connection) -> None: # noqa: C901, PLR091
162158

163159
cfg = load_routing_configuration()
164160
task_id = run.task_id
165-
splits_url = (
166-
f"{cfg.get('server_url', '')}api_splits/get/{task_id}/Task_{task_id}_splits.arff"
167-
)
161+
splits_url = f"{cfg.get('server_url', '')}api_splits/get/{task_id}/Task_{task_id}_splits.arff"
168162
try:
169163
splits_content = _fetch_arff(splits_url)
170164
except Exception:

tests/routers/openml/runs_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ def test_upload_run_unknown_flow(mocker: MockerFixture, py_api: TestClient) -> N
145145

146146

147147
def test_upload_run_success(
148-
mocker: MockerFixture, tmp_path: pathlib.Path, py_api: TestClient,
148+
mocker: MockerFixture,
149+
tmp_path: pathlib.Path,
150+
py_api: TestClient,
149151
) -> None:
150152
"""A fully valid POST /runs should return 201 with a run_id."""
151153
fake_user = mocker.MagicMock(user_id=16)

0 commit comments

Comments
 (0)