MCPcopy Create free account
hub / github.com/apache/arrow / test_export_import_schema_float_pointer

Function test_export_import_schema_float_pointer

python/pyarrow/tests/test_cffi.py:305–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

303
304@needs_cffi
305def test_export_import_schema_float_pointer():
306 # Previous versions of the R Arrow library used to pass pointer
307 # values as a double.
308 c_schema = ffi.new("struct ArrowSchema*")
309 ptr_schema = int(ffi.cast("uintptr_t", c_schema))
310
311 match = "Passing a pointer value as a float is unsafe"
312 with pytest.warns(UserWarning, match=match):
313 make_schema()._export_to_c(float(ptr_schema))
314 with pytest.warns(UserWarning, match=match):
315 schema_new = pa.Schema._import_from_c(float(ptr_schema))
316 assert schema_new == make_schema()
317
318
319def check_export_import_batch(array_type, exporter, importer, batch_factory):

Callers

nothing calls this directly

Calls 3

make_schemaFunction · 0.70
newMethod · 0.45
castMethod · 0.45

Tested by

no test coverage detected