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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.12']
python-version: ['3.10', '3.12']
poetry-version: [1.8]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: '3.10'

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13']
poetry-version: [1.8]

steps:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Raise the minimum supported versions to Python 3.10 and YDB SDK 3.30.0

## 0.1.24 ##
* Fix DBAPI typing with newer YDB SDK releases

Expand Down
1,131 changes: 8 additions & 1,123 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ readme = "README.md"
repository = "https://github.com/ydb-platform/ydb-python-dbapi/"

[tool.poetry.dependencies]
python = "^3.8"
ydb = "^3.26.7"
python = "^3.10"
ydb = "^3.30.0"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.5.0"
Expand Down Expand Up @@ -37,7 +37,7 @@ tests = "pytest"
[tool.ruff]
exclude = [".venv", ".git", ".github/scripts", "__pycache__", "build", "dist", "venv"]
line-length = 79
target-version = "py39"
target-version = "py310"
src = ["ydb_dbapi", "tests"]

[tool.ruff.lint]
Expand Down
21 changes: 9 additions & 12 deletions ydb_dbapi/cursors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
import functools
import itertools
from collections.abc import AsyncIterator
from collections.abc import Callable
from collections.abc import Generator
from collections.abc import Iterator
from collections.abc import Sequence
from inspect import iscoroutinefunction
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
from typing import Union

import ydb

Expand All @@ -28,18 +27,16 @@
from .connections import AsyncConnection
from .connections import Connection

ParametersType = Union[
ParametersType = (
dict[
str,
Union[
Any,
tuple[Any, Union[ydb.PrimitiveType, ydb.AbstractTypeBuilder]],
ydb.TypedValue,
],
],
list[Any],
tuple[Any, ...],
]
Any
| tuple[Any, ydb.PrimitiveType | ydb.AbstractTypeBuilder]
| ydb.TypedValue,
]
| list[Any]
| tuple[Any, ...]
)


def _get_column_type(type_obj: Any) -> str:
Expand Down
6 changes: 3 additions & 3 deletions ydb_dbapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import importlib.util
import json
import re
from collections.abc import Callable
from enum import Enum
from inspect import Parameter
from inspect import iscoroutinefunction
from inspect import signature
from typing import Any
from typing import Callable
from typing import Union
from typing import get_args
from typing import get_origin
Expand Down Expand Up @@ -389,7 +389,7 @@ def _validate_positional_parameters(
parameters: dict | list | tuple,
positional_count: int,
) -> None:
if not isinstance(parameters, (list, tuple)):
if not isinstance(parameters, list | tuple):
raise ProgrammingError(
"Positional placeholders (%s) require parameters "
"to be a list or tuple."
Expand Down Expand Up @@ -517,7 +517,7 @@ def convert_query_parameters(

converted_params: dict = {}

if isinstance(parameters, (list, tuple)):
if isinstance(parameters, list | tuple):
for i, value in enumerate(parameters, start=1):
converted_params[f"$p{i}"] = _wrap_value(value)
else:
Expand Down
Loading