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

Function test_string_builder_append

python/pyarrow/tests/test_builder.py:33–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32
33def test_string_builder_append():
34 sbuilder = StringBuilder()
35 sbuilder.append(b"a byte string")
36 sbuilder.append("a string")
37 sbuilder.append(math.nan)
38 sbuilder.append(None)
39 assert len(sbuilder) == 4
40 assert sbuilder.null_count == 2
41 arr = sbuilder.finish()
42 assert len(sbuilder) == 0
43 assert isinstance(arr, pa.Array)
44 assert arr.null_count == 2
45 assert arr.type == 'str'
46 expected = ["a byte string", "a string", None, None]
47 assert arr.to_pylist() == expected
48
49
50def test_string_builder_append_values():

Callers

nothing calls this directly

Calls 4

StringBuilderClass · 0.85
lenFunction · 0.85
appendMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected