Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@charris
Copy link
Member

@charris charris commented Jul 7, 2024

Backport of #26744.

Unfortunately, did a bit of cleanup to make this work, so this needs a bit of a careful look.

I.e. the first commit moves the "allow legacy promotion" logic to later, where the signature is more readily available. That shouldn't change anything else (the only reason it is used earlier is to decide if checking for "should use scalar" makes sense, but that code handles unknown dtypes just fine).

It then fixes the string add promoter to close the issue.

Closes #26735

@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Jul 7, 2024
@charris charris added this to the 2.0.1 release milestone Jul 7, 2024
@charris
Copy link
Member Author

charris commented Jul 7, 2024

@seberg get_npy_promotion_state is not defined in 2.0.x, and seems pretty widely used in main. How important is this fix?

Copy link
Member

@seberg seberg left a comment

Choose a reason for hiding this comment

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

This should work, but it mostly affects stringDType, so it isn't super important.

seberg and others added 7 commits July 8, 2024 08:35
Moving it to later makes it much simpler to consider also the
signature in the decision, which is necessary to get things right.

In practice, it might also be possible to just reject it later,
but this seemed actually simpler.
Also makes it reject forced unicode selection, since that doens't
work.
@charris charris merged commit c62c7ff into numpy:maintenance/2.0.x Jul 16, 2024
@charris charris deleted the backport-26744 branch July 16, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants