Skip to content

Fix compatibility issue with Table masked init and numpy 1.21 - #11364

Merged
mhvk merged 1 commit into
astropy:masterfrom
taldcroft:table-masked-init-warnings
Mar 3, 2021
Merged

mhvk merged 1 commit into
astropy:masterfrom
taldcroft:table-masked-init-warnings

Conversation

@taldcroft

Copy link
Copy Markdown
Member

Description

See #11291 and numpy/numpy#18425 for the full story, but in short numpy 1.21 is introducing a new FutureWarning that was causing tests to fail, but without impact to normal usage. This is due to pytest turning warnings into errors, which numpy was catching and causing the array dtype to become object.

This code specifies that the new FutureWarning is always issued as a warning, which overrides (for this warning) the generic pytest directive to convert warnings to errors. In local testing at least this does the right thing.

This patch is a band-aid for now to get tests passing again. It would be good to get this out in a bug-fix release before numpy 1.21 is released.

Fixes #11291

@pllim pllim 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.

Numpy-dev job finally passed. Thanks! 🎉

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, very good and minimal fix. Thanks!

@mhvk
mhvk merged commit 1615588 into astropy:master Mar 3, 2021
@taldcroft
taldcroft deleted the table-masked-init-warnings branch March 7, 2021 11:12
astrofrog pushed a commit that referenced this pull request Mar 16, 2021
Fix compatibility issue with Table masked init and numpy 1.21
eteq pushed a commit that referenced this pull request Mar 25, 2021
Fix compatibility issue with Table masked init and numpy 1.21
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.

TST: Table data type comparison fails with numpy-dev

3 participants