This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch rc/1.3.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rc/1.3.3 by this push:
new dd70a752ed8 [Py-client] Fix dataset contains null value contract error
(#13762) (#13767)
dd70a752ed8 is described below
commit dd70a752ed8deedcb8482b9f03e3bdf723055a4e
Author: Haonan <[email protected]>
AuthorDate: Wed Oct 16 10:16:19 2024 +0800
[Py-client] Fix dataset contains null value contract error (#13762)
(#13767)
---
.../client-py/iotdb/utils/IoTDBRpcDataSet.py | 12 +---------
.../tests/integration/test_new_data_types.py | 27 ++++++++++++++++++++++
2 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/iotdb-client/client-py/iotdb/utils/IoTDBRpcDataSet.py
b/iotdb-client/client-py/iotdb/utils/IoTDBRpcDataSet.py
index d575caf8a09..e9621bf81b9 100644
--- a/iotdb-client/client-py/iotdb/utils/IoTDBRpcDataSet.py
+++ b/iotdb-client/client-py/iotdb/utils/IoTDBRpcDataSet.py
@@ -216,17 +216,7 @@ class IoTDBRpcDataSet(object):
data_array.dtype.newbyteorder("<")
)
if len(data_array) < total_length:
- # INT32, INT64, BOOLEAN, TIMESTAMP, DATE
- if (
- data_type == 0
- or data_type == 1
- or data_type == 2
- or data_type == 8
- or data_type == 9
- ):
- tmp_array = np.full(total_length, np.nan, np.float32)
- else:
- tmp_array = np.full(total_length, None, dtype=object)
+ tmp_array = np.full(total_length, None, dtype=object)
bitmap_buffer = self.__query_data_set.bitmapList[location]
buffer = _to_bitbuffer(bitmap_buffer)
diff --git a/iotdb-client/client-py/tests/integration/test_new_data_types.py
b/iotdb-client/client-py/tests/integration/test_new_data_types.py
index 3452d6c1b7b..ce89b5b8316 100644
--- a/iotdb-client/client-py/tests/integration/test_new_data_types.py
+++ b/iotdb-client/client-py/tests/integration/test_new_data_types.py
@@ -153,5 +153,32 @@ def session_test(use_session_pool=False):
assert rows == 10
assert columns == 5
+ session.insert_records(
+ [device_id, device_id],
+ [11, 12],
+ [measurements_new_type, ["s_02", "s_03", "s_04"]],
+ [
+ data_types_new_type,
+ [
+ TSDataType.TIMESTAMP,
+ TSDataType.BLOB,
+ TSDataType.STRING,
+ ],
+ ],
+ [
+ [date(1971, 1, 1), 11, b"\x12\x34", "test11"],
+ [12, b"\x12\x34", "test12"],
+ ],
+ )
+
+ with session.execute_query_statement(
+ "select s_01,s_02,s_03,s_04 from root.sg_test_01.d_04 where time >
10"
+ ) as dataset:
+ cnt = 0
+ while dataset.has_next():
+ cnt += 1
+ print(dataset.next())
+ assert cnt == 2
+
# close session connection.
session.close()