From 29f7e15974af2fe11b3431973a0057431a880076 Mon Sep 17 00:00:00 2001 From: Gal Topper Date: Tue, 10 Sep 2024 14:21:10 +0800 Subject: [PATCH] Revert breaking change in #126 (#128) [IG-23065](https://iguazio.atlassian.net/browse/IG-23065) --- v3io/dataplane/kv_array.py | 2 +- v3io/dataplane/request.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/v3io/dataplane/kv_array.py b/v3io/dataplane/kv_array.py index 11f2325..a1670c2 100644 --- a/v3io/dataplane/kv_array.py +++ b/v3io/dataplane/kv_array.py @@ -39,7 +39,7 @@ def encode_array(array_value, typecode): "II" + typecode * num_items, num_items * 8, operand_type, *array_value ) - return base64.b64encode(encoded_array).decode("utf-8") + return base64.b64encode(encoded_array) def decode(encoded_array): diff --git a/v3io/dataplane/request.py b/v3io/dataplane/request.py index 68f80e3..0e58645 100644 --- a/v3io/dataplane/request.py +++ b/v3io/dataplane/request.py @@ -454,10 +454,10 @@ def _dict_to_typed_attributes(d): type_value = value elif isinstance(value, list): type_key = "B" - type_value = v3io.dataplane.kv_array.encode_list(value) + type_value = v3io.dataplane.kv_array.encode_list(value).decode("utf-8") elif isinstance(value, array.array): type_key = "B" - type_value = v3io.dataplane.kv_array.encode_array(value, value.typecode) + type_value = v3io.dataplane.kv_array.encode_array(value, value.typecode).decode("utf-8") elif isinstance(value, datetime.datetime): type_key = "TS" type_value = v3io.dataplane.kv_timestamp.encode(value)