Skip to content

Commit 6d2c4f7

Browse files
Use the generic positive-int-or-None validator for max_total_rows
The dbapi connection modules validated `max_total_rows` through a specialised helper that the client package no longer ships. Switch to the shared `_validate_positive_int_or_none` import so both packages share one validator; error wording is byte-identical when the helper is given `name="max_total_rows"`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bbbff2f commit 6d2c4f7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/dqlitedbapi/aio/connection.py

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

88
import dqliteclient.exceptions as _client_exc
99
from dqliteclient import DqliteConnection
10-
from dqliteclient.protocol import _validate_max_total_rows, _validate_positive_int_or_none
10+
from dqliteclient.protocol import _validate_positive_int_or_none
1111
from dqlitedbapi.aio.cursor import AsyncCursor
1212
from dqlitedbapi.connection import _is_no_transaction_error
1313
from dqlitedbapi.exceptions import InterfaceError, OperationalError, ProgrammingError
@@ -47,7 +47,7 @@ def __init__(
4747
self._address = address
4848
self._database = database
4949
self._timeout = timeout
50-
self._max_total_rows = _validate_max_total_rows(max_total_rows)
50+
self._max_total_rows = _validate_positive_int_or_none(max_total_rows, "max_total_rows")
5151
self._max_continuation_frames = _validate_positive_int_or_none(
5252
max_continuation_frames, "max_continuation_frames"
5353
)

src/dqlitedbapi/connection.py

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

1111
import dqliteclient.exceptions as _client_exc
1212
from dqliteclient import DqliteConnection
13-
from dqliteclient.protocol import _validate_max_total_rows, _validate_positive_int_or_none
13+
from dqliteclient.protocol import _validate_positive_int_or_none
1414
from dqlitedbapi.cursor import Cursor
1515
from dqlitedbapi.exceptions import InterfaceError, OperationalError, ProgrammingError
1616

@@ -125,7 +125,7 @@ def __init__(
125125
self._address = address
126126
self._database = database
127127
self._timeout = timeout
128-
self._max_total_rows = _validate_max_total_rows(max_total_rows)
128+
self._max_total_rows = _validate_positive_int_or_none(max_total_rows, "max_total_rows")
129129
self._max_continuation_frames = _validate_positive_int_or_none(
130130
max_continuation_frames, "max_continuation_frames"
131131
)

0 commit comments

Comments
 (0)