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
Fix pandas 1.5+ FutureWarning
in .str.split(..., expand=True)
#9704
Conversation
Can one of the admins verify this patch? Admins can comment |
.str.split(..., expand=True)
add to allowlist |
@JacobHayes this looks good and fixes the issue on my system. Do you mind if I push a commit that adds a test to the PR? |
That'd be great, thanks! |
@JacobHayes turns out I don't have the credentials to do that. Right here, can you add: @pytest.mark.parametrize("index", [None, [0]], ids=["range_index", "other index"])
def test_str_split_no_warning(index):
df = pd.DataFrame({"a": ["a\nb"]}, index=index)
ddf = dd.from_pandas(df, npartitions=1)
pd_a = df["a"].str.split("\n", n=1, expand=True)
dd_a = ddf["a"].str.split("\n", n=1, expand=True)
assert_eq(dd_a, pd_a) |
Co-authored-by: Paul Hobson <pmhobson@gmail.com>
Ah, great - I should have expected |
.str.split(..., expand=True)
FutureWarning
in .str.split(..., expand=True)
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.
Thanks @JacobHayes, this looks great!
Note the test failure here is unrelated to the changes in this PR and being handled over in #9701
Also, I noticed this is your first code contribution to this repository. Welcome!
.str.split(..., expand=True)
withInt64Index
triggers pandas FutureWarning #9703pre-commit run --all-files
I confirmed manually that this removed the warning with the repro code in #9703, but didn't add an explicit test for it.