This is an automated email from the ASF dual-hosted git repository.

jiangtian pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git


The following commit(s) were added to refs/heads/develop by this push:
     new c9db8d1e Fix python check isnull. (#458)
c9db8d1e is described below

commit c9db8d1e0b32f6536e8612db303396ba19854c76
Author: Colin Lee <[email protected]>
AuthorDate: Wed Apr 9 17:15:44 2025 +0800

    Fix python check isnull. (#458)
    
    * fix python is null error.
    
    * fix compile dist.
---
 .gitignore                          | 2 +-
 python/requirements.txt             | 2 +-
 python/setup.py                     | 2 +-
 python/tests/test_write_and_read.py | 7 +++++++
 python/tsfile/tsfile_reader.pyx     | 4 ++--
 5 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index fa3c6a26..b9070546 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,7 +38,7 @@ python/tests/*.tsfile
 
 cpp/cmake-build-debug-mingw/
 cpp/third_party/googletest-release-1.12.1.zip
-
+cpp/third_party/zlib-1.2.13/zconf.h
 .vscode/
 
 build/*
diff --git a/python/requirements.txt b/python/requirements.txt
index 1f579636..9e6c929e 100644
--- a/python/requirements.txt
+++ b/python/requirements.txt
@@ -21,5 +21,5 @@ cython==3.0.10
 numpy==1.26.4
 pandas==2.2.2
 setuptools==70.0.0
-wheel
+wheel==0.45.1
 
diff --git a/python/setup.py b/python/setup.py
index 84727278..6edeea0b 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -24,7 +24,7 @@ import platform
 import shutil
 import os
 
-version = "2.1.0.dev"
+version = "2.1.0.dev0"
 system = platform.system()
 
 def copy_tsfile_lib(source_dir, target_dir, suffix):
diff --git a/python/tests/test_write_and_read.py 
b/python/tests/test_write_and_read.py
index 817c3f67..6d0dbe7a 100644
--- a/python/tests/test_write_and_read.py
+++ b/python/tests/test_write_and_read.py
@@ -62,6 +62,8 @@ def test_row_record_write_and_read():
 
 def test_tablet_write_and_read():
     try:
+        if os.path.exists("record_write_and_read.tsfile"):
+            os.remove("record_write_and_read.tsfile")
         writer = TsFileWriter("tablet_write_and_read.tsfile")
         measurement_num = 30
         for i in range(measurement_num):
@@ -124,6 +126,11 @@ def test_table_writer_and_reader():
                 while result.next():
                     cur_time = result.get_value_by_name("time")
                     assert result.get_value_by_name("device") == "device" + 
str(cur_time)
+                    assert result.is_null_by_name("device") == False
+                    assert result.is_null_by_name("value") == False
+                    assert result.is_null_by_index(1) == False
+                    assert result.is_null_by_index(2) == False
+                    assert result.is_null_by_index(3) == False
                     assert result.get_value_by_name("value") == cur_time * 
100.0
                     cur_line = cur_line + 1
                 assert cur_line == 11
diff --git a/python/tsfile/tsfile_reader.pyx b/python/tsfile/tsfile_reader.pyx
index f9106be5..e8d38d7d 100644
--- a/python/tsfile/tsfile_reader.pyx
+++ b/python/tsfile/tsfile_reader.pyx
@@ -208,7 +208,7 @@ cdef class ResultSetPy:
             raise IndexError(
                 f"Column index {index} out of range (column count: 
{len(self.metadata.column_list)})"
             )
-        return tsfile_result_set_is_null_by_index(self.result, index - 1)
+        return tsfile_result_set_is_null_by_index(self.result, index)
 
     def is_null_by_name(self, name : str):
         """
@@ -216,7 +216,7 @@ cdef class ResultSetPy:
         """
         self.check_result_set_invalid()
         ind = self.metadata.get_column_name_index(name, self.is_tree)
-        return self.is_null_by_index(ind + 1)
+        return self.is_null_by_index(ind)
 
     def check_result_set_invalid(self):
         if not self.valid:

Reply via email to