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

Function test_string_view_builder

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

Source from the content-addressed store, hash-verified

67
68
69def test_string_view_builder():
70 builder = StringViewBuilder()
71 builder.append(b"a byte string")
72 builder.append("a string")
73 builder.append("a longer not-inlined string")
74 builder.append(math.nan)
75 builder.append_values([None, "text"])
76 assert len(builder) == 6
77 assert builder.null_count == 2
78 arr = builder.finish()
79 assert isinstance(arr, pa.Array)
80 assert arr.null_count == 2
81 assert arr.type == 'string_view'
82 expected = [
83 "a byte string", "a string", "a longer not-inlined string", None, None, "text"
84 ]
85 assert arr.to_pylist() == expected

Callers

nothing calls this directly

Calls 5

StringViewBuilderClass · 0.85
lenFunction · 0.85
appendMethod · 0.45
append_valuesMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected