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

TST (string dtype): Adjust indexing string tests #59541

Merged
merged 6 commits into from
Sep 9, 2024

Conversation

phofl
Copy link
Member

@phofl phofl commented Aug 17, 2024

xref #54792

@jorisvandenbossche jorisvandenbossche added the Strings String extension data type and string data label Aug 18, 2024
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment on lines 539 to 542
if using_infer_string:
with pytest.raises(TypeError, match="Invalid value"):
df.iloc[:, 0] = df.iloc[:, 0].astype(np.int64)
else:
Copy link
Member

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.

Copy link
Member Author

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

@jorisvandenbossche jorisvandenbossche changed the title TST (string-dtype): Adjust indexing string tests TST (string dtype): Adjust indexing string tests Sep 9, 2024
@jorisvandenbossche jorisvandenbossche merged commit b7dedf5 into pandas-dev:main Sep 9, 2024
47 checks passed
@jorisvandenbossche jorisvandenbossche deleted the string-indexing branch September 9, 2024 15:24
ammar-qazi pushed a commit to ammar-qazi/pandas that referenced this pull request Sep 9, 2024
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
@jorisvandenbossche jorisvandenbossche added this to the 2.3 milestone Oct 10, 2024
jorisvandenbossche added a commit to jorisvandenbossche/pandas that referenced this pull request Oct 10, 2024
Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
jorisvandenbossche added a commit that referenced this pull request Oct 10, 2024
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
backported Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants