Skip to content

Commit 796175a

Browse files
authored
Merge pull request #210 fix check truncated setting with None table_client_settings
2 parents 53e86eb + cd9d725 commit 796175a

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ydb/convert.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
_DecimalInfRepr = 10**35
1414
_DecimalSignedInfRepr = -(10**35)
1515
_primitive_type_by_id = {}
16+
_default_allow_truncated_result = True
1617

1718

1819
def _initialize():
@@ -491,16 +492,18 @@ def __init__(self, result_sets_pb, table_client_settings=None):
491492
if table_client_settings is None
492493
else table_client_settings._make_result_sets_lazy
493494
)
495+
496+
allow_truncated_result = _default_allow_truncated_result
497+
if table_client_settings:
498+
allow_truncated_result = table_client_settings._allow_truncated_result
499+
494500
result_sets = []
495501
initializer = (
496502
_ResultSet.from_message if not make_lazy else _ResultSet.lazy_from_message
497503
)
498504
for result_set in result_sets_pb:
499505
result_set = initializer(result_set, table_client_settings)
500-
if (
501-
result_set.truncated
502-
and not table_client_settings._allow_truncated_result
503-
):
506+
if result_set.truncated and not allow_truncated_result:
504507
raise issues.TruncatedResponseError(
505508
"Response for the request was truncated by server"
506509
)

ydb/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ def __init__(self):
10041004
self._native_json_in_result_sets = False
10051005
self._native_interval_in_result_sets = False
10061006
self._native_timestamp_in_result_sets = False
1007-
self._allow_truncated_result = True
1007+
self._allow_truncated_result = convert._default_allow_truncated_result
10081008

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

0 commit comments

Comments
 (0)