Skip to content

DEP: Ensure the string promotion FutureWarning is raised - #18999

Merged
mattip merged 1 commit into
numpy:mainfrom
seberg:raise-futurewarning-string-promotion
May 16, 2021
Merged

mattip merged 1 commit into
numpy:mainfrom
seberg:raise-futurewarning-string-promotion

Conversation

@seberg

@seberg seberg commented May 12, 2021

Copy link
Copy Markdown
Member

Promotion errors are currently ignored and instead we use object
as dtype. This means that the FutureWarning is ignored when raised.

It also means that there is no way to opt into "future" behaviour,
although arguably, we may want to force dtype=object in any case
if a promotion error occurred (or some signal at least).

Closes gh-18721
Addresses gh-18425 (Does not actually fix it, but chances are we won't)

Promotion errors are currently ignored and instead we use `object`
as dtype. This means that the FutureWarning is ignored when raised.

It also means that there is no way to opt into "future" behaviour,
although arguably, we may want to force `dtype=object` in any case
if a promotion error occurred (or some signal at least).

Closes numpygh-18721
Addresses numpygh-18425  (Does not actually fix it, but chances are we won't)
@mattip
mattip merged commit 7b4a60f into numpy:main May 16, 2021
@mattip

mattip commented May 16, 2021

Copy link
Copy Markdown
Member

Thanks @seberg

@jbrockmendel

Copy link
Copy Markdown
Contributor

@seberg im going through the affected pandas tests to update our usage. A couple of questions:

  1. should this warning be suppressed inside np.ndim?
  2. What about cases where we want the future behavior don't know whether we have np.array([1, 2, 3]) or np.array([1, 2, '3'])?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New warnings in numpy wheels nightly builds.

3 participants