From 7e538355551e5daf062ae5049fc43fc50860bf55 Mon Sep 17 00:00:00 2001 From: Oleg Ovcharuk Date: Tue, 19 Nov 2024 15:05:02 +0300 Subject: [PATCH] Fix python 3.8 typing --- ydb_dbapi/cursors.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ydb_dbapi/cursors.py b/ydb_dbapi/cursors.py index c10ca80..c3c62f7 100644 --- a/ydb_dbapi/cursors.py +++ b/ydb_dbapi/cursors.py @@ -5,6 +5,7 @@ from collections.abc import Generator from collections.abc import Iterator from collections.abc import Sequence +from typing import TYPE_CHECKING from typing import Any from typing import Union @@ -18,14 +19,15 @@ from .utils import handle_ydb_errors from .utils import maybe_get_current_trace_id -ParametersType = dict[ - str, - Union[ - Any, - tuple[Any, Union[ydb.PrimitiveType, ydb.AbstractTypeBuilder]], - ydb.TypedValue, - ], -] +if TYPE_CHECKING: + ParametersType = dict[ + str, + Union[ + Any, + tuple[Any, Union[ydb.PrimitiveType, ydb.AbstractTypeBuilder]], + ydb.TypedValue, + ], + ] def _get_column_type(type_obj: Any) -> str: