Skip to content

Commit 57211c0

Browse files
committed
fix
1 parent f8641cc commit 57211c0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/test_polars_integration.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -190,30 +190,30 @@ def test_create_array_in_cpp(cpp_lib):
190190
assert schema_ptr.value is not None, "Received null schema pointer from C++"
191191
assert array_ptr.value is not None, "Received null array pointer from C++"
192192

193-
print(f" Array created (schema_ptr={hex(schema_ptr.value)}, array_ptr={hex(array_ptr.value)})")
193+
print(f" Array created (schema_ptr={hex(schema_ptr.value)}, array_ptr={hex(array_ptr.value)})")
194194

195195
print("\n2. Converting C pointers to PyCapsules in Python...")
196196
schema_capsule, array_capsule = pointer_to_arrow_capsule(schema_ptr.value, array_ptr.value)
197-
print(" PyCapsules created in Python")
197+
print(" PyCapsules created in Python")
198198

199199
print("\n3. Importing to PyArrow...")
200200
arrow_array = pa.Array._import_from_c_capsule(schema_capsule, array_capsule)
201-
print(f" Arrow type: {arrow_array.type}")
202-
print(f" Arrow values: {arrow_array.to_pylist()}")
201+
print(f" Arrow type: {arrow_array.type}")
202+
print(f" Arrow values: {arrow_array.to_pylist()}")
203203

204204
# Convert to Polars
205205
print("\n4. Converting to Polars...")
206206
polars_series = pl.from_arrow(arrow_array)
207-
print(f" Polars series: {polars_series.to_list()}")
207+
print(f" Polars series: {polars_series.to_list()}")
208208

209209
# Verify expected values
210210
expected = [10, 20, None, 40, 50]
211211
actual = polars_series.to_list()
212212

213213
assert expected == actual, f"Data mismatch! Expected: {expected}, Actual: {actual}"
214-
print(" Data matches expected values!")
214+
print(" Data matches expected values!")
215215
print("\n" + "=" * 70)
216-
print("Test 1 PASSED")
216+
print("Test 1 PASSED")
217217
print("=" * 70)
218218

219219

@@ -234,22 +234,22 @@ def test_polars_to_cpp(cpp_lib):
234234
print("\n2. Exporting to Arrow C Data Interface...")
235235
arrow_array = test_series.to_arrow()
236236
schema_capsule, array_capsule = arrow_array.__arrow_c_array__()
237-
print(" Capsules created")
237+
print(" Capsules created")
238238

239239
# Extract pointers from capsules
240240
print("\n3. Extracting raw pointers from capsules...")
241241
schema_ptr = capsule_to_pointer(schema_capsule, "arrow_schema")
242242
array_ptr = capsule_to_pointer(array_capsule, "arrow_array")
243-
print(f" Pointers extracted (schema={hex(schema_ptr)}, array={hex(array_ptr)})")
243+
print(f" Pointers extracted (schema={hex(schema_ptr)}, array={hex(array_ptr)})")
244244

245245
# Verify in C++
246246
print("\n4. Verifying in C++ (sparrow)...")
247247
result = lib.verify_array_size_from_pointers(schema_ptr, array_ptr, 5)
248248

249249
assert result == 0, "C++ verification failed"
250-
print(" C++ successfully imported and verified the array!")
250+
print(" C++ successfully imported and verified the array!")
251251
print("\n" + "=" * 70)
252-
print("Test 2 PASSED")
252+
print("Test 2 PASSED")
253253
print("=" * 70)
254254

255255

@@ -291,7 +291,7 @@ def test_roundtrip(cpp_lib):
291291
assert schema_ptr_out.value is not None, "Received null schema output pointer from C++"
292292
assert array_ptr_out.value is not None, "Received null array output pointer from C++"
293293

294-
print(" C++ processed the array")
294+
print(" C++ processed the array")
295295

296296
print("\n4. Converting output to capsules...")
297297
schema_capsule_out, array_capsule_out = pointer_to_arrow_capsule(schema_ptr_out.value, array_ptr_out.value)
@@ -305,9 +305,9 @@ def test_roundtrip(cpp_lib):
305305
result_data = result_series.to_list()
306306
assert original_data == result_data, f"Data mismatch! Original: {original_data}, Result: {result_data}"
307307

308-
print(" Round-trip successful - data matches!")
308+
print(" Round-trip successful - data matches!")
309309
print("\n" + "=" * 70)
310-
print("Test 3 PASSED")
310+
print("Test 3 PASSED")
311311
print("=" * 70)
312312

313313

0 commit comments

Comments
 (0)