(root_allocator)
| 419 | @pytest.mark.xfail(reason="from_buffers is only supported for " |
| 420 | "primitive arrays yet") |
| 421 | def test_jvm_string_array(root_allocator): |
| 422 | data = ["string", None, "töst"] |
| 423 | cls = "org.apache.arrow.vector.VarCharVector" |
| 424 | jvm_vector = jpype.JClass(cls)("vector", root_allocator) |
| 425 | jvm_vector.allocateNew() |
| 426 | |
| 427 | for i, string in enumerate(data): |
| 428 | holder = _string_to_varchar_holder(root_allocator, "string") |
| 429 | jvm_vector.setSafe(i, holder) |
| 430 | jvm_vector.setValueCount(i + 1) |
| 431 | |
| 432 | py_array = pa.array(data, type=pa.string()) |
| 433 | jvm_array = pa_jvm.array(jvm_vector) |
| 434 | |
| 435 | assert py_array.equals(jvm_array) |
nothing calls this directly
no test coverage detected