Skip to content

Commit 4c562be

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

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/database/evaluations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def get_math_functions(function_type: str, connection: Connection) -> Sequence[Row]:
1111
return cast(
12-
Sequence[Row],
12+
"Sequence[Row]",
1313
connection.execute(
1414
text(
1515
"""

src/database/flows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
def get_subflows(for_flow: int, expdb: Connection) -> Sequence[Row]:
88
return cast(
9-
Sequence[Row],
9+
"Sequence[Row]",
1010
expdb.execute(
1111
text(
1212
"""
@@ -36,7 +36,7 @@ def get_tags(flow_id: int, expdb: Connection) -> list[str]:
3636

3737
def get_parameters(flow_id: int, expdb: Connection) -> Sequence[Row]:
3838
return cast(
39-
Sequence[Row],
39+
"Sequence[Row]",
4040
expdb.execute(
4141
text(
4242
"""

src/database/studies.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_study_data(study: Row, expdb: Connection) -> Sequence[Row]:
4343
"""
4444
if study.type_ == StudyType.TASK:
4545
return cast(
46-
Sequence[Row],
46+
"Sequence[Row]",
4747
expdb.execute(
4848
text(
4949
"""
@@ -56,7 +56,7 @@ def get_study_data(study: Row, expdb: Connection) -> Sequence[Row]:
5656
).all(),
5757
)
5858
return cast(
59-
Sequence[Row],
59+
"Sequence[Row]",
6060
expdb.execute(
6161
text(
6262
"""
@@ -103,7 +103,7 @@ def create(study: CreateStudy, user: User, expdb: Connection) -> int:
103103
},
104104
)
105105
(study_id,) = expdb.execute(text("""SELECT LAST_INSERT_ID();""")).one()
106-
return cast(int, study_id)
106+
return cast("int", study_id)
107107

108108

109109
def attach_task(task_id: int, study_id: int, user: User, expdb: Connection) -> None:

src/database/tasks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def get(id_: int, expdb: Connection) -> Row | None:
1919

2020
def get_task_types(expdb: Connection) -> Sequence[Row]:
2121
return cast(
22-
Sequence[Row],
22+
"Sequence[Row]",
2323
expdb.execute(
2424
text(
2525
"""
@@ -46,7 +46,7 @@ def get_task_type(task_type_id: int, expdb: Connection) -> Row | None:
4646

4747
def get_input_for_task_type(task_type_id: int, expdb: Connection) -> Sequence[Row]:
4848
return cast(
49-
Sequence[Row],
49+
"Sequence[Row]",
5050
expdb.execute(
5151
text(
5252
"""
@@ -62,7 +62,7 @@ def get_input_for_task_type(task_type_id: int, expdb: Connection) -> Sequence[Ro
6262

6363
def get_input_for_task(id_: int, expdb: Connection) -> Sequence[Row]:
6464
return cast(
65-
Sequence[Row],
65+
"Sequence[Row]",
6666
expdb.execute(
6767
text(
6868
"""
@@ -78,7 +78,7 @@ def get_input_for_task(id_: int, expdb: Connection) -> Sequence[Row]:
7878

7979
def get_task_type_inout_with_template(task_type: int, expdb: Connection) -> Sequence[Row]:
8080
return cast(
81-
Sequence[Row],
81+
"Sequence[Row]",
8282
expdb.execute(
8383
text(
8484
"""

src/routers/openml/tasktype.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def get_task_type(
5353
task_type = _normalize_task_type(task_type_record)
5454
# Some names are quoted, or have typos in their comma-separation (e.g. 'A ,B')
5555
task_type["creator"] = [
56-
creator.strip(' "') for creator in cast(str, task_type["creator"]).split(",")
56+
creator.strip(' "') for creator in cast("str", task_type["creator"]).split(",")
5757
]
5858
if contributors := task_type.pop("contributors"):
5959
task_type["contributor"] = [
60-
creator.strip(' "') for creator in cast(str, contributors).split(",")
60+
creator.strip(' "') for creator in cast("str", contributors).split(",")
6161
]
6262
task_type["creation_date"] = task_type.pop("creationDate")
6363
task_type_inputs = get_input_for_task_type(task_type_id, expdb)

0 commit comments

Comments
 (0)