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

REGR: fix read_parquet with column of large strings (avoid overflow from concat) #55691

Merged

Conversation

jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche added Regression Functionality that used to work in a prior pandas version IO Parquet parquet, feather labels Oct 25, 2023
@jorisvandenbossche jorisvandenbossche added this to the 2.1.2 milestone Oct 25, 2023
Comment on lines 1145 to 1153
def test_string_column_above_2GB(self, tmp_path, pa):
# https://github.com/pandas-dev/pandas/issues/55606
# above 2GB of string data
v1 = b"x" * 100000000
v2 = b"x" * 147483646
df = pd.DataFrame({"strings": [v1] * 20 + [v2] + ["x"] * 20}, dtype="string")
df.to_parquet(tmp_path / "test.parquet")
result = read_parquet(tmp_path / "test.parquet")
assert result["strings"].dtype == "string"
Copy link
Member Author

Choose a reason for hiding this comment

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

This test is quite slow (around 20s for me) and uses a lot of memory (> 5 GB), so I am not sure we should add it ... (our "slow" tests are still run by default, so this would be annoying when running the tests locally)

Copy link
Member

Choose a reason for hiding this comment

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

I'm in favor of not adding this test given the potential CI load. Maybe an ASV since this is "performance" related too given the memory trigger if you think that makes sense.

At minimum, would be good to comment in pandas/core/arrays/string_.py why the modification was made

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a comment about it, and "removed" the test: I left the code here, to make it easier to run that test in the future by just uncommenting (or if we enable some high_memory mark that would be disabled by default)

Adding a ASV sounds useful, but wouldn't prevent catching a regression, as also for ASV we would use a smaller dataset. So leaving that out of the PR here.

@lithomas1
Copy link
Member

thanks @jorisvandenbossche.

@lithomas1 lithomas1 merged commit 05f2f71 into pandas-dev:main Oct 26, 2023
36 of 39 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Oct 26, 2023
@jorisvandenbossche jorisvandenbossche deleted the read-parquet-large-strings branch October 26, 2023 14:08
lithomas1 pushed a commit that referenced this pull request Oct 26, 2023
…n of large strings (avoid overflow from concat)) (#55706)

Backport PR #55691: REGR: fix read_parquet with column of large strings (avoid overflow from concat)

Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Parquet parquet, feather Regression Functionality that used to work in a prior pandas version
Projects
None yet
3 participants