Skip to content

Commit 400da2b

Browse files
committed
- Added YDB convert support EmptyDict, EmptyList types
- Added EXTERNAL_ERROR status code and issue ExternalError
1 parent 24be185 commit 400da2b

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
* Added YDB convert support EmptyDict, EmptyList types
2+
* Added EXTERNAL_ERROR status code and issue ExternalError
3+
14
## 2.13.4 ##
25
* Fixed set keep_in_cache algorithm
36

Diff for: ydb/_tx_ctx_impl.py

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def execute_request_factory(
152152

153153
if keep_in_cache:
154154
request.query_cache_policy.keep_in_cache = True
155+
155156
request.query.MergeFrom(query_pb)
156157
tx_control = _apis.ydb_table.TransactionControl()
157158
tx_control.commit_tx = commit_tx

Diff for: ydb/convert.py

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def _pb_to_void(type_pb, value_pb, table_client_settings):
125125
"dict_type": _pb_to_dict,
126126
"struct_type": _pb_to_struct,
127127
"void_type": _pb_to_void,
128+
"empty_list_type": _pb_to_list,
129+
"empty_dict_type": _pb_to_dict,
128130
}
129131

130132

Diff for: ydb/issues.py

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class StatusCode(enum.IntEnum):
3232
UNDETERMINED = _apis.StatusIds.UNDETERMINED
3333
UNSUPPORTED = _apis.StatusIds.UNSUPPORTED
3434
SESSION_BUSY = _apis.StatusIds.SESSION_BUSY
35+
EXTERNAL_ERROR = _apis.StatusIds.EXTERNAL_ERROR
3536

3637
CONNECTION_LOST = _TRANSPORT_STATUSES_FIRST + 10
3738
CONNECTION_FAILURE = _TRANSPORT_STATUSES_FIRST + 20
@@ -152,6 +153,10 @@ class SessionBusy(Error):
152153
status = StatusCode.SESSION_BUSY
153154

154155

156+
class ExternalError(Error):
157+
status = StatusCode.EXTERNAL_ERROR
158+
159+
155160
class SessionPoolEmpty(Error, queue.Empty):
156161
status = StatusCode.SESSION_POOL_EMPTY
157162

@@ -191,6 +196,7 @@ def _format_response(response):
191196
StatusCode.UNDETERMINED: Undetermined,
192197
StatusCode.UNSUPPORTED: Unsupported,
193198
StatusCode.SESSION_BUSY: SessionBusy,
199+
StatusCode.EXTERNAL_ERROR: ExternalError,
194200
}
195201

196202

0 commit comments

Comments
 (0)