Skip to content

Commit f0f29ef

Browse files
author
fotinosk
committed
feat(dict converter): add tests
1 parent 866c28b commit f0f29ef

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

python/pyarrow/tests/test_array.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4468,3 +4468,19 @@ def test_dunders_checked_overflow():
44684468
arr ** pa.scalar(2, type=pa.int8())
44694469
with pytest.raises(pa.ArrowInvalid, match=error_match):
44704470
arr / (-arr)
4471+
4472+
4473+
def test_dictionary_large_string_and_binary():
4474+
# Test dictionary with large_string values
4475+
arr_str = pa.array(
4476+
["a", "b", "a"], type=pa.dictionary(pa.int32(), pa.large_string())
4477+
)
4478+
assert arr_str.type.value_type == pa.large_string()
4479+
assert arr_str.to_pylist() == ["a", "b", "a"]
4480+
4481+
# Test dictionary with large_binary values
4482+
arr_bin = pa.array(
4483+
[b"x", b"y", b"x"], type=pa.dictionary(pa.int32(), pa.large_binary())
4484+
)
4485+
assert arr_bin.type.value_type == pa.large_binary()
4486+
assert arr_bin.to_pylist() == [b"x", b"y", b"x"]

python/pyarrow/tests/test_dict_array_converter.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)