-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST (string dtype): Adjust indexing string tests #59541
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
Conversation
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.
Looks good!
if using_infer_string: | ||
with pytest.raises(TypeError, match="Invalid value"): | ||
df.iloc[:, 0] = df.iloc[:, 0].astype(np.int64) | ||
else: |
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.
No idea if it is tested elsewhere, but we should also keep some tests where we assert that if you have object dtype and set with another dtype, that it preserves the object dtype. So alternatively, could also add dtype=object
to the dataframe construction and for the rest keep the current test.
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.
Updated, but not sure if I like this any better tbh
Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
Co-authored-by: Joris Van den Bossche <[email protected]>
xref #54792