This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch try_fix_python in repository https://gitbox.apache.org/repos/asf/tsfile.git
commit cb8cf044f0257a85780c6a8b5b3858631bd6ea9f Author: HTHou <[email protected]> AuthorDate: Mon Aug 5 23:36:57 2024 +0800 try --- python/test.py | 8 ++++---- python/tsfile/tsfile.pxd | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/test.py b/python/test.py index ebbea6fa..9edca232 100644 --- a/python/test.py +++ b/python/test.py @@ -60,11 +60,11 @@ def test_write_tsfile(): ts.write_tsfile(DATA_PATH + "/txt.tsfile", TABLE_NAME, df) # full datatypes test - time = np.arange(1, 1001, dtype=np.int64) # int64 - level = np.linspace(2000, 3000, num=1000, dtype=np.float32) # float32 - num = np.arange(10000, 11000, dtype=np.int64) # int64 + time = np.arange(1, 1001, dtype=np.dtype(">i8")) # int64 + level = np.linspace(2000, 3000, num=1000, dtype=np.dtype(">f4")) # float32 + num = np.arange(10000, 11000, dtype=np.dtype(">i8")) # int64 bools = np.random.choice([True, False], 1000) # bool - double = np.random.rand(1000) # double + double = np.linspace(0, 1000, num=1000, dtype=np.dtype(">f8")) # double df = pd.DataFrame( {"Time": time, "level": level, "num": num, "bools": bools, "double": double} ) diff --git a/python/tsfile/tsfile.pxd b/python/tsfile/tsfile.pxd index a41794e2..1480371f 100644 --- a/python/tsfile/tsfile.pxd +++ b/python/tsfile/tsfile.pxd @@ -89,7 +89,7 @@ cdef extern from "./TsFile-cwrapper.h": # writer tsfile data ErrorCode tsfile_register_table(CTsFileWriter writer, TableSchema* schema) ErrorCode tsfile_register_table_column(CTsFileWriter writer, const char* table_name, ColumnSchema* schema) - TsFileRowData create_tsfile_row(const char* table_name, timestamp timestamp, int column_length) + TsFileRowData create_tsfile_row(const char* table_name, timestamp time, int column_length) ErrorCode insert_data_into_tsfile_row_int32(TsFileRowData row_data, char* column_name, int value) ErrorCode insert_data_into_tsfile_row_int64(TsFileRowData row_data, char* column_name, long long value) ErrorCode insert_data_into_tsfile_row_float(TsFileRowData row_data, char* column_name, float value)
