DEP: Give a visible warning when align=
to dtype is a non-bool
#29301
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This seems generally confusing. I would like to make it keyword only, but this already gives a warning when loading very old pickles, meaning I am not quite sure we should change away from a warning quickly.
We should fix things around pickling and start pickling in a way that makes it easier to move to keyword only arguments. (I suppose one could detect the case of
np.dtype(obj, False, True)
and assume it is via unpickling, but...I am assuming that it is OK to (eventually) break unpickling these 10+ year old files, but I am not in a rush to actually do so and go through with the deprecation.
Closes gh-8158
The one way to really avoid all of those warnings for ancient pickles, might be to just explicitly accept
np.dtype(obj, 0, 1)
(and maybe the currentnp.dtype(obj, False, True)
) exactly, basically just hoping that such a call came from pickle.That is a whim, but users are unlikely to pass those exact parameters in practice probably...