Skip to content

Commit a800dd0

Browse files
authored
Merge pull request #374 fix python2 compatible
2 parents 1f653da + 461ca21 commit a800dd0

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

ydb/_errors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from dataclasses import dataclass
2-
from typing import Optional
32

43
from . import issues
54

@@ -59,5 +58,6 @@ def check_retriable_error(err, retry_settings, attempt):
5958

6059
@dataclass
6160
class ErrorRetryInfo:
62-
is_retriable: bool
63-
sleep_timeout_seconds: Optional[float]
61+
def __init__(self, is_retriable, sleep_timeout_seconds=None):
62+
self.is_retriable = is_retriable
63+
self.sleep_timeout_seconds = sleep_timeout_seconds

ydb/global_settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
from . import table
33

44

5-
def global_allow_truncated_result(enabled: bool = True):
5+
def global_allow_truncated_result(enabled=True):
66
"""
77
call global_allow_truncated_result(False) for more safe execution and compatible with future changes
88
"""
99
convert._default_allow_truncated_result = enabled
1010

1111

12-
def global_allow_split_transactions(enabled: bool):
12+
def global_allow_split_transactions(enabled):
1313
"""
1414
call global_allow_truncated_result(False) for more safe execution and compatible with future changes
1515
"""

ydb/issues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def _format_issues(issues):
173173

174174
def _format_response(response):
175175
fmt_issues = _format_issues(response.issues)
176-
return f"{fmt_issues} (server_code: {response.status})"
176+
return "{0} (server_code: {1})".format(fmt_issues, response.status)
177177

178178

179179
_success_status_codes = {StatusCode.STATUS_CODE_UNSPECIFIED, StatusCode.SUCCESS}

ydb/table.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,8 +2230,7 @@ def __init__(
22302230
session_state,
22312231
session,
22322232
tx_mode=None,
2233-
*,
2234-
allow_split_transactions=_allow_split_transaction
2233+
allow_split_transactions=_allow_split_transaction,
22352234
):
22362235
"""
22372236
An object that provides a simple transaction context manager that allows statements execution

0 commit comments

Comments
 (0)