Copilot commented on code in PR #493:
URL: https://github.com/apache/tsfile/pull/493#discussion_r2086013997


##########
python/tsfile/tsfile_py_cpp.pyx:
##########
@@ -347,6 +347,119 @@ cdef TsFileReader tsfile_reader_new_c(object pathname) 
except +:
     check_error(errno)
     return reader
 
+cpdef object get_tsfile_config():
+    return {
+        "tsblock_mem_inc_step_size_": 
g_config_value_.tsblock_mem_inc_step_size_,
+        "tsblock_max_memory_": g_config_value_.tsblock_max_memory_,
+        "page_writer_max_point_num_": 
g_config_value_.page_writer_max_point_num_,
+        "page_writer_max_memory_bytes_": 
g_config_value_.page_writer_max_memory_bytes_,
+        "max_degree_of_index_node_": g_config_value_.max_degree_of_index_node_,
+        "tsfile_index_bloom_filter_error_percent_": 
g_config_value_.tsfile_index_bloom_filter_error_percent_,
+        
"time_encoding_type_":TSEncodingPy(int(g_config_value_.time_encoding_type_)),
+        "time_data_type_": TSDataTypePy(int(g_config_value_.time_data_type_)),
+        "time_compress_type_": 
CompressorPy(int(g_config_value_.time_compress_type_)),
+        "chunk_group_size_threshold_": 
g_config_value_.chunk_group_size_threshold_,
+        
"record_count_for_next_mem_check_":g_config_value_.record_count_for_next_mem_check_,
+        "encrypt_flag_":g_config_value_.encrypt_flag_,
+        
"boolean_encoding_type_":TSEncodingPy(int(g_config_value_.boolean_encoding_type_)),
+        "int32_encoding_type_": 
TSEncodingPy(int(g_config_value_.int32_encoding_type_)),
+        "int64_encoding_type_": 
TSEncodingPy(int(g_config_value_.int64_encoding_type_)),
+        "float_encoding_type_": 
TSEncodingPy(int(g_config_value_.float_encoding_type_)),
+        "double_encoding_type_": 
TSEncodingPy(int(g_config_value_.double_encoding_type_)),
+        "string_encoding_type_": 
TSEncodingPy(int(g_config_value_.string_encoding_type_)),
+        "default_compression_type_": 
CompressorPy(int(g_config_value_.default_compression_type_)),
+    }
+
+
+cpdef void set_tsfile_config(dict new_config):
+    if "tsblock_mem_inc_step_size_" in new_config:
+        _check_uint32(new_config["tsblock_mem_inc_step_size_"])
+        g_config_value_.tsblock_max_memory_ = 
new_config["tsblock_mem_inc_step_size_"]

Review Comment:
   The assignment for 'tsblock_mem_inc_step_size_' mistakenly updates 
'tsblock_max_memory_'. The value from 
'new_config["tsblock_mem_inc_step_size_"]' should be assigned to 
'g_config_value_.tsblock_mem_inc_step_size_' instead.
   ```suggestion
           g_config_value_.tsblock_mem_inc_step_size_ = 
new_config["tsblock_mem_inc_step_size_"]
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@tsfile.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to