Skip to content

Commit ded6cbf

Browse files
authored
Merge pull request #209 V3 fix truncated response
2 parents 1f8b190 + 8a32f24 commit ded6cbf

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Fixed exception while create ResultSet with None table_settings
2+
13
## 3.0.1b7 ##
24
* BROKEN CHANGE: deny any action in transaction after commit/rollback
35
* BROKEN CHANGE: raise exception for truncated response by default

ydb/convert.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
_DecimalInfRepr = 10**35
1313
_DecimalSignedInfRepr = -(10**35)
1414
_primitive_type_by_id = {}
15+
_default_allow_truncated_result = False
1516

1617

1718
def _initialize():
@@ -484,16 +485,18 @@ def __init__(self, result_sets_pb, table_client_settings=None):
484485
if table_client_settings is None
485486
else table_client_settings._make_result_sets_lazy
486487
)
488+
489+
allow_truncated_result = _default_allow_truncated_result
490+
if table_client_settings:
491+
allow_truncated_result = table_client_settings._allow_truncated_result
492+
487493
result_sets = []
488494
initializer = (
489495
_ResultSet.from_message if not make_lazy else _ResultSet.lazy_from_message
490496
)
491497
for result_set in result_sets_pb:
492498
result_set = initializer(result_set, table_client_settings)
493-
if (
494-
result_set.truncated
495-
and not table_client_settings._allow_truncated_result
496-
):
499+
if result_set.truncated and not allow_truncated_result:
497500
raise issues.TruncatedResponseError(
498501
"Response for the request was truncated by server"
499502
)

ydb/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ def __init__(self):
10021002
self._native_json_in_result_sets = False
10031003
self._native_interval_in_result_sets = False
10041004
self._native_timestamp_in_result_sets = False
1005-
self._allow_truncated_result = False
1005+
self._allow_truncated_result = convert._default_allow_truncated_result
10061006

10071007
def with_native_timestamp_in_result_sets(self, enabled):
10081008
# type:(bool) -> ydb.TableClientSettings

0 commit comments

Comments
 (0)