Skip to content

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

Merged
merged 6 commits into from
Jul 13, 2023

Conversation

SanjithChockan
Copy link
Contributor

@SanjithChockan SanjithChockan commented Jul 11, 2023

Instead of checking pyarrow array's type to be string, it could be a dictionary of values with string type when partitioned. Performed checks for both cases.

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Needs a unit test and whatsnew entry in 2.1.0.rst

@mroeschke mroeschke added IO Parquet parquet, feather Arrow pyarrow functionality labels Jul 11, 2023
@SanjithChockan SanjithChockan changed the title checking for value type when parquet is partitioned BUG: checking for value type when parquet is partitioned Jul 12, 2023
@SanjithChockan SanjithChockan requested a review from mroeschke July 12, 2023 04:24

array = pa

arr = array.array([1, 2, 3], array.dictionary(array.int32(), array.int32()))
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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

@@ -533,13 +533,13 @@ Sparse

ExtensionArray
^^^^^^^^^^^^^^
- Bug in :class:`ArrowStringArray` constructor raises value error on dictionary on values with string type (:issue:`54074`)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Bug in :class:`ArrowStringArray` constructor raises value error on dictionary on values with string type (:issue:`54074`)
- Bug in :class:`ArrowStringArray` constructor raises ``ValueError`` with dictionary types of strings (:issue:`54074`)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@SanjithChockan SanjithChockan requested a review from mroeschke July 13, 2023 07:09
@mroeschke mroeschke added this to the 2.1 milestone Jul 13, 2023
@mroeschke mroeschke merged commit 7c876ed into pandas-dev:main Jul 13, 2023
@mroeschke
Copy link
Member

Thanks @SanjithChockan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality IO Parquet parquet, feather
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: read_parquet raises ValueError on partitioned dataset when partition col is string[pyarrow]
2 participants