Skip to content

Commit c9db8d1

Browse files
authored
Fix python check isnull. (#458)
* fix python is null error. * fix compile dist.
1 parent c7d21f3 commit c9db8d1

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ python/tests/*.tsfile
3838

3939
cpp/cmake-build-debug-mingw/
4040
cpp/third_party/googletest-release-1.12.1.zip
41-
41+
cpp/third_party/zlib-1.2.13/zconf.h
4242
.vscode/
4343

4444
build/*

python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ cython==3.0.10
2121
numpy==1.26.4
2222
pandas==2.2.2
2323
setuptools==70.0.0
24-
wheel
24+
wheel==0.45.1
2525

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import shutil
2525
import os
2626

27-
version = "2.1.0.dev"
27+
version = "2.1.0.dev0"
2828
system = platform.system()
2929

3030
def copy_tsfile_lib(source_dir, target_dir, suffix):

python/tests/test_write_and_read.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def test_row_record_write_and_read():
6262

6363
def test_tablet_write_and_read():
6464
try:
65+
if os.path.exists("record_write_and_read.tsfile"):
66+
os.remove("record_write_and_read.tsfile")
6567
writer = TsFileWriter("tablet_write_and_read.tsfile")
6668
measurement_num = 30
6769
for i in range(measurement_num):
@@ -124,6 +126,11 @@ def test_table_writer_and_reader():
124126
while result.next():
125127
cur_time = result.get_value_by_name("time")
126128
assert result.get_value_by_name("device") == "device" + str(cur_time)
129+
assert result.is_null_by_name("device") == False
130+
assert result.is_null_by_name("value") == False
131+
assert result.is_null_by_index(1) == False
132+
assert result.is_null_by_index(2) == False
133+
assert result.is_null_by_index(3) == False
127134
assert result.get_value_by_name("value") == cur_time * 100.0
128135
cur_line = cur_line + 1
129136
assert cur_line == 11

python/tsfile/tsfile_reader.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ cdef class ResultSetPy:
208208
raise IndexError(
209209
f"Column index {index} out of range (column count: {len(self.metadata.column_list)})"
210210
)
211-
return tsfile_result_set_is_null_by_index(self.result, index - 1)
211+
return tsfile_result_set_is_null_by_index(self.result, index)
212212

213213
def is_null_by_name(self, name : str):
214214
"""
215215
Checks whether the field with the specified column name in the result set is null.
216216
"""
217217
self.check_result_set_invalid()
218218
ind = self.metadata.get_column_name_index(name, self.is_tree)
219-
return self.is_null_by_index(ind + 1)
219+
return self.is_null_by_index(ind)
220220

221221
def check_result_set_invalid(self):
222222
if not self.valid:

0 commit comments

Comments
 (0)