Skip to content

BUG: DataFrame.update doesn't preserve dtypes #55558

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

Closed

Conversation

MichaelTiemannOSC
Copy link
Contributor

@MichaelTiemannOSC MichaelTiemannOSC commented Oct 17, 2023

Preserve dtype when updating from dataframe whose NA values don't affect original.

I don't know the best place to put the test case in the tests/frame or the tests/dtype directory.

Preserve dtype when updating from dataframe whose NA values don't affect original.

I don't know the best place to put the test case in the tests/frame or the tests/dtype directory.

Signed-off-by: Michael Tiemann <[email protected]>
@MichaelTiemannOSC
Copy link
Contributor Author

I found pandas/tests/frame/methods/test_update.py and will update test case there.

@simonjayhawkins simonjayhawkins changed the title Fix for issue #55509 BUG: DataFrame.update doesn't preserve dtypes Oct 17, 2023
@simonjayhawkins simonjayhawkins added Bug Dtype Conversions Unexpected or buggy dtype conversions labels Oct 17, 2023
Created generic test case that probes a number of basic types, not only `bool` (original report).

Signed-off-by: Michael Tiemann <[email protected]>
It appears that only `bool` and `datetime64` dtypes need special handling to pass `test_update_preserve_dtype`, so no need to see whether int, float, complex, string, or other types need fixing.

Signed-off-by: Michael Tiemann <[email protected]>
@MichaelTiemannOSC MichaelTiemannOSC marked this pull request as ready for review October 18, 2023 14:03
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Nov 20, 2023
@MichaelTiemannOSC
Copy link
Contributor Author

My changes obsoleted by #55634

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: DataFrame.update doesn't preserve dtypes
2 participants