Skip to content

Commit 21eca54

Browse files
authored
Merge pull request optuna#5885 from boringbyte/fix/v3.0.0.c.py
Simplify type annotations for `optuna/storages/_rdb/alembic/versions/v3.0.0.c.py`
2 parents 4eb2375 + 5dae4c1 commit 21eca54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

optuna/storages/_rdb/alembic/versions/v3.0.0.c.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
77
"""
88

9+
from __future__ import annotations
10+
911
import enum
1012

1113
import numpy as np
1214
from alembic import op
1315
import sqlalchemy as sa
1416
from sqlalchemy.exc import SQLAlchemyError
1517
from sqlalchemy import orm
16-
from typing import Optional
17-
from typing import Tuple
1818

1919
try:
2020
from sqlalchemy.orm import declarative_base
@@ -54,7 +54,7 @@ class TrialIntermediateValueType(enum.Enum):
5454
def intermediate_value_to_stored_repr(
5555
cls,
5656
value: float,
57-
) -> Tuple[Optional[float], TrialIntermediateValueType]:
57+
) -> tuple[float | None, TrialIntermediateValueType]:
5858
if np.isnan(value):
5959
return (None, cls.TrialIntermediateValueType.NAN)
6060
elif value == float("inf"):

0 commit comments

Comments
 (0)