Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-75: Fix handling of empty strings #32

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/src/arrow/types/primitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class PrimitiveBuilder : public ArrayBuilder {
int32_t new_capacity = util::next_power2(length_ + length);
RETURN_NOT_OK(Resize(new_capacity));
}
memcpy(raw_buffer() + length_, values, length * elsize_);
if (length > 0) memcpy(raw_buffer() + length_, values, length * elsize_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put braces around this (with the memcpy on its own line)?


if (null_bytes != nullptr) {
AppendNulls(null_bytes, length);
Expand Down
4 changes: 2 additions & 2 deletions python/pyarrow/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ def test_list_format(self):
assert result == expected

def test_string_format(self):
arr = pyarrow.from_pylist(['foo', None, 'bar'])
arr = pyarrow.from_pylist(['foo', None, ''])
result = fmt.array_format(arr)
expected = """\
[
'foo',
NA,
'bar'
''
]"""
assert result == expected

Expand Down