This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch ht/playgrand
in repository https://gitbox.apache.org/repos/asf/tsfile.git
The following commit(s) were added to refs/heads/ht/playgrand by this push:
new f4b161f1 retry test
f4b161f1 is described below
commit f4b161f154086fbfa402fd22823405daed626971
Author: HTHou <[email protected]>
AuthorDate: Fri Jul 12 18:14:41 2024 +0800
retry test
---
python/test.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/python/test.py b/python/test.py
index 88dd4b90..4b2df4e7 100644
--- a/python/test.py
+++ b/python/test.py
@@ -19,7 +19,6 @@
import os
import platform
import shutil
-import glob
import unittest as ut
import numpy as np
@@ -74,9 +73,6 @@ def test_write_tsfile():
# test reading data
def test_read_tsfile():
- # skip test on windows because of the bug in the tsfile library
- if platform.system() == "Windows":
- return
# test read a non-existent file
with ut.TestCase().assertRaises(FileNotFoundError):
ts.read_tsfile(DATA_PATH + "/notexist.tsfile", TABLE_NAME, ["level",
"num"])
@@ -92,6 +88,7 @@ def test_read_tsfile():
# test read data
## 1. read all data
df, _ = ts.read_tsfile(FILE_NAME, TABLE_NAME, ["level", "num", "bools",
"double"])
+ print("1. read all data")
assert df.shape == (1000, 5)
assert df["level"].dtype == np.float32
assert df["Time"].dtype == np.int64
@@ -101,6 +98,7 @@ def test_read_tsfile():
## 2. read with chunksize
df, _ = ts.read_tsfile(FILE_NAME, TABLE_NAME, ["level", "num"],
chunksize=100)
+ print("2. read with chunksize")
assert df.shape == (100, 3)
assert df["level"].dtype == np.float32
assert df["Time"].sum() == np.arange(1, 101).sum()
@@ -110,6 +108,7 @@ def test_read_tsfile():
with ts.read_tsfile(
FILE_NAME, TABLE_NAME, ["level", "num"], iterator=True, chunksize=100
) as reader:
+ print("3. read with iterator")
for chunk, _ in reader:
assert chunk.shape == (100, 3)
assert chunk["level"].dtype == np.float32
@@ -122,6 +121,7 @@ def test_read_tsfile():
## 4. read with time scale
df, _ = ts.read_tsfile(FILE_NAME, TABLE_NAME, ["num"], start_time=50,
end_time=99)
+ print("4. read with time scale")
assert df.shape == (50, 2)
assert df["num"][0] == 10049
assert df["num"][9] == 10058
@@ -130,6 +130,7 @@ def test_read_tsfile():
df, _ = ts.read_tsfile(
FILE_NAME, TABLE_NAME, ["num"], start_time=50, end_time=99,
chunksize=10
)
+ print("5. read with time scale and chunksize")
assert df.shape == (10, 2)
assert df["num"][0] == 10049
assert df["num"][9] == 10058
@@ -145,6 +146,7 @@ def test_read_tsfile():
iterator=True,
chunksize=10,
) as reader:
+ print("6. read with time scale and iterator")
for chunk, _ in reader:
assert chunk.shape == (10, 2)
assert chunk["num"][0] == 10049 + chunk_num * 10