CLN: remove unnecessary usage of option_context with future.infer_string in tests#65048
Draft
jorisvandenbossche wants to merge 2 commits intopandas-dev:mainfrom
Draft
CLN: remove unnecessary usage of option_context with future.infer_string in tests#65048jorisvandenbossche wants to merge 2 commits intopandas-dev:mainfrom
jorisvandenbossche wants to merge 2 commits intopandas-dev:mainfrom
Conversation
Comment on lines
-171
to
-176
|
|
||
| df = feather.read_feather( | ||
| handles.handle, columns=columns, use_threads=bool(use_threads) | ||
| ) | ||
| # Convert any StringDtype columns to object dtype (pyarrow always | ||
| # uses string dtype even when the infer_string option is False) |
Member
Author
There was a problem hiding this comment.
this is also handled in the arrow_table_to_pandas call below (with the only difference that there we do an additional fillna(None) to keep the behaviour consistent that pyarrow conversion to pandas with object dtype uses None for missing values)
Member
|
Nice cleanup! LGTM pending green |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Noticed this in one of the tests: this is mostly a leftover from the time when the option was not enabled by default, and we wanted to test some of those things consistently (not only in the one build that enabled it).
Now that is no longer needed (and we also still have one build that disables it). The remaining use cases of
pd.option_context("future.infer_string", ..)are in the (dtype) constructor tests that explicitly test the resulting dtype, and where it would be more verbose to update those tests to depend onusing_infer_stringfixture to have it pass everywhere.