You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2024/10/15 03:41:52 UTC
(iotdb) branch rc133_py_dataset created (now 996238b9e25)
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a change to branch rc133_py_dataset
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at 996238b9e25 [Py-client] Fix dataset contains null value contract error (#13762)
This branch includes the following new commits:
new 996238b9e25 [Py-client] Fix dataset contains null value contract error (#13762)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(iotdb) 01/01: [Py-client] Fix dataset contains null value contract error (#13762)
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch rc133_py_dataset
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 996238b9e25f37b944e58f1ed280e4b60d336edd
Author: Haonan <hh...@outlook.com>
AuthorDate: Tue Oct 15 11:36:11 2024 +0800
[Py-client] Fix dataset contains null value contract error (#13762)
* add test
* fix query dataset
* try IT
* try IT
* try IT
* try IT
* try IT
* fix
* fix IT
---
.../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()