Skip to content

BUG: wrong future Warning on string assignment in certain condition #57402

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

Merged

Conversation

MarcoGorelli
Copy link
Member

is this it? finally? 🤞

@MarcoGorelli MarcoGorelli marked this pull request as ready for review February 13, 2024 16:02
# Columns F and G will initially be set to np.void.
# Here, we replace those temporary `np.void` columns with
# columns of the appropriate dtype, based on `value`.
arr = sanitize_array(value, Index(range(1)), copy=False)
Copy link
Member

Choose a reason for hiding this comment

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

construct_1d_arraylike_from_scalar?

Copy link
Member

Choose a reason for hiding this comment

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

Discussed during the dev meeting. If the idea is to fill with the appropriate missing value, I think you can use a combination of infer_fill_value with construct_1d_arraylike_from_scalar

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks! will update

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this would run into the same issues that #56321 addressed

I'd factored out the common logic, if there's a better way perhaps it can be addressed separately?

@mroeschke mroeschke added Warnings Warnings that appear or should be added to pandas PDEP6-related related to PDEP6 (not upcasting during setitem-like Series operations) labels Feb 14, 2024
Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

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

solution seems find except matts comment

@MarcoGorelli MarcoGorelli marked this pull request as draft February 14, 2024 20:04
@MarcoGorelli MarcoGorelli marked this pull request as ready for review February 15, 2024 17:43
@mroeschke mroeschke added this to the 2.2.1 milestone Feb 16, 2024
@mroeschke mroeschke merged commit aa6ab37 into pandas-dev:main Feb 16, 2024
@mroeschke
Copy link
Member

Thanks @MarcoGorelli

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Feb 16, 2024
mroeschke pushed a commit that referenced this pull request Feb 16, 2024
…ng assignment in certain condition) (#57460)

Backport PR #57402: BUG: wrong future Warning on string assignment in certain condition

Co-authored-by: Marco Edward Gorelli <[email protected]>
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
…andas-dev#57402)

* whatsnew

* factor out construct_1d_array_from_inferred_fill_value

* 🏷️ typing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PDEP6-related related to PDEP6 (not upcasting during setitem-like Series operations) Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: wrong future Warning on string assignment in certain condition
3 participants