Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Added YDB convert support EmptyDict, EmptyList types #372

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Added YDB convert support EmptyDict, EmptyList types
* Added EXTERNAL_ERROR status code and issue ExternalError

## 2.13.4 ##
* Fixed set keep_in_cache algorithm

Expand Down
1 change: 1 addition & 0 deletions ydb/_tx_ctx_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def execute_request_factory(

if keep_in_cache:
request.query_cache_policy.keep_in_cache = True

request.query.MergeFrom(query_pb)
tx_control = _apis.ydb_table.TransactionControl()
tx_control.commit_tx = commit_tx
Expand Down
2 changes: 2 additions & 0 deletions ydb/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ def _pb_to_void(type_pb, value_pb, table_client_settings):
"dict_type": _pb_to_dict,
"struct_type": _pb_to_struct,
"void_type": _pb_to_void,
"empty_list_type": _pb_to_list,
"empty_dict_type": _pb_to_dict,
}


Expand Down
6 changes: 6 additions & 0 deletions ydb/issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class StatusCode(enum.IntEnum):
UNDETERMINED = _apis.StatusIds.UNDETERMINED
UNSUPPORTED = _apis.StatusIds.UNSUPPORTED
SESSION_BUSY = _apis.StatusIds.SESSION_BUSY
EXTERNAL_ERROR = _apis.StatusIds.EXTERNAL_ERROR

CONNECTION_LOST = _TRANSPORT_STATUSES_FIRST + 10
CONNECTION_FAILURE = _TRANSPORT_STATUSES_FIRST + 20
Expand Down Expand Up @@ -152,6 +153,10 @@ class SessionBusy(Error):
status = StatusCode.SESSION_BUSY


class ExternalError(Error):
status = StatusCode.EXTERNAL_ERROR


class SessionPoolEmpty(Error, queue.Empty):
status = StatusCode.SESSION_POOL_EMPTY

Expand Down Expand Up @@ -191,6 +196,7 @@ def _format_response(response):
StatusCode.UNDETERMINED: Undetermined,
StatusCode.UNSUPPORTED: Unsupported,
StatusCode.SESSION_BUSY: SessionBusy,
StatusCode.EXTERNAL_ERROR: ExternalError,
}


Expand Down
Loading