Skip to content

BUG: handle scalar input in np.char.replace - #25484

Merged
ngoldbaum merged 1 commit into
numpy:mainfrom
ngoldbaum:fix-replace-scalar
Dec 24, 2023
Merged

ngoldbaum merged 1 commit into
numpy:mainfrom
ngoldbaum:fix-replace-scalar

Conversation

@ngoldbaum

Copy link
Copy Markdown
Member

I merged #25171 last night. However, it was never updated to handle scalars properly following #25335, so the test added in that PR started failing as soon as #25171 was merged.

This updates the replace implementation to properly handle scalars following the other chararray functions.

ping @lysnikolaou if you happen to see this and want to do it another way, please let me know, I just did this quickly to fix CI.

@seberg seberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, scalar return logic is of course in the air (it's not the same as ufuncs), but unchanged here and presumably before.

@lysnikolaou lysnikolaou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants