-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: checking for value type when parquet is partitioned #54074
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
Changes from 3 commits
dd630ff
d754d1a
465c9d7
5423fc4
e184bc6
9bdb611
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,24 @@ def test_constructor_not_string_type_raises(array, chunked): | |
ArrowStringArray(arr) | ||
|
||
|
||
@skip_if_no_pyarrow | ||
SanjithChockan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@pytest.mark.parametrize("chunked", [True, False]) | ||
def test_constructor_not_string_type_value_dictionary_raises(chunked): | ||
import pyarrow as pa | ||
SanjithChockan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
array = pa | ||
SanjithChockan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
arr = array.array([1, 2, 3], array.dictionary(array.int32(), array.int32())) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add a separate test where a dictionary type of strings does work? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a case with valid input and used assert to test if value_type is string |
||
if chunked: | ||
arr = pa.chunked_array(arr) | ||
|
||
msg = re.escape( | ||
"ArrowStringArray requires a PyArrow (chunked) array of string type" | ||
) | ||
with pytest.raises(ValueError, match=msg): | ||
ArrowStringArray(arr) | ||
|
||
|
||
@skip_if_no_pyarrow | ||
def test_from_sequence_wrong_dtype_raises(): | ||
with pd.option_context("string_storage", "python"): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!