Handle pandas NA values in 'filter_array_like' #505
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.
Description:
A recent pandas bug fix pandas-dev/pandas#45249 changed the way pandas handles NA values. The buggy way, which is not aligned with how pandas NA values work, was to treat it as 'None of the Above'. In other words, in
filter_array_like
,pd.NA == True
andpd.NA == False
would both returnFalse
. The correct pandas semantics is forpd.NA == True
andpd.NA == False
to equalpd.NA
. That however diverges from numpy where numpy assumes the 'None of the Above' semantic.This patch forces pandas to use the 'None of the Above' semantic, to keep it inline with numpy semantics.
filter_array_like
with newest pandas version #504