Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Fix devdeps job #14075

Merged
merged 2 commits into from Nov 30, 2022
Merged

TST: Fix devdeps job #14075

merged 2 commits into from Nov 30, 2022

Conversation

pllim
Copy link
Member

@pllim pllim commented Nov 29, 2022

Description

This pull request is fix #14073

I also see some pandas warning, so I'll mark this as draft and see if I can also fix that here.

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see "When to rebase and squash commits".
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the Extra CI label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the no-changelog-entry-needed label. If this is a manual backport, use the skip-changelog-checks label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • Is a milestone set? Milestone must be set but astropy-bot check might be missing; do not let the green checkmark fool you.
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate backport-X.Y.x label(s) before merge.

@pllim pllim added no-changelog-entry-needed numpy-dev 💤 backport-v5.0.x on-merge: backport to v5.0.x 💤 backport-v5.2.x on-merge: backport to v5.2.x labels Nov 29, 2022
@pllim pllim added this to the v5.0.6 milestone Nov 29, 2022
@github-actions

This comment was marked as resolved.

@pllim pllim added table Extra CI Run cron CI as part of PR labels Nov 29, 2022
@pllim

This comment was marked as resolved.

@pllim pllim marked this pull request as ready for review November 29, 2022 23:21
@@ -2158,7 +2159,15 @@ def test_masking(self, use_nullable_int):
else:
assert t2[name].dtype.kind == "i"

assert_array_equal(column.data, t2[name].data.astype(column.dtype))
with warnings.catch_warnings():
# This warning pops up when use_nullable_int is False
Copy link
Member Author

Choose a reason for hiding this comment

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

table maintainers should see if ignoring this is ok.

astropy/io/ascii/core.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

@pllim - looks good, just a small warning on how to avoid getting the warning.

@@ -2158,7 +2159,15 @@ def test_masking(self, use_nullable_int):
else:
assert t2[name].dtype.kind == "i"

assert_array_equal(column.data, t2[name].data.astype(column.dtype))
with warnings.catch_warnings():
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be

with np.errstate(invalid='ignore'):
    assert_...

(I think that's OK for all numpy versions.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. Applied. Thanks!

Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

Looks good! I'd tend to rebase & squash, but rerunning all the CI seems wasteful, so perhaps best to merge as is.

TST: Ignore RuntimeWarning
in astropy/table/tests/test_table.py that pops up when
use_nullable_int is False and pandas is 1.5.2

Co-authored-by: Marten van Kerkwijk <mhvk@astro.utoronto.ca>
@pllim
Copy link
Member Author

pllim commented Nov 30, 2022

5 commits do look excessive. I squashed them. Thanks for the review!

@WilliamJamieson
Copy link
Contributor

pre-commit.ci autofix

Copy link
Contributor

@dhomeier dhomeier left a comment

Choose a reason for hiding this comment

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

io.ascii is good, too, thanks for the fix! Just wondering how this could have slipped under the radar since numpy 1.20...

@dhomeier dhomeier added the 💤 merge-when-ci-passes Do not use: We have auto-merge option now. label Nov 30, 2022
@pllim
Copy link
Member Author

pllim commented Nov 30, 2022

With numpy 1.23, I see this when I call numpy.str but somehow that is not caught in the CI. We do not ignore this in setup.cfg so maybe the try-except blocks messed with pytest warning filter? 🤷

DeprecationWarning: `np.str` is a deprecated alias for the builtin `str`.
To silence this warning, use `str` by itself. Doing this will not modify any behavior and is safe.
If you specifically wanted the numpy scalar type, use `np.str_` here.
Deprecated in NumPy 1.20; for more details and guidance:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

@pllim
Copy link
Member Author

pllim commented Nov 30, 2022

linkcheck failure is unrelated.

Copy link
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

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

Looks fine to me.

@pllim pllim merged commit dfd2bf0 into astropy:main Nov 30, 2022
@pllim
Copy link
Member Author

pllim commented Nov 30, 2022

Thanks, all!

meeseeksmachine pushed a commit to meeseeksmachine/astropy that referenced this pull request Nov 30, 2022
meeseeksmachine pushed a commit to meeseeksmachine/astropy that referenced this pull request Nov 30, 2022
@pllim pllim deleted the fix-devdeps-io-ascii branch November 30, 2022 22:50
astrofrog added a commit that referenced this pull request Dec 1, 2022
…075-on-v5.2.x

Backport PR #14075 on branch v5.2.x (TST: Fix devdeps job)
astrofrog added a commit that referenced this pull request Dec 1, 2022
…075-on-v5.0.x

Backport PR #14075 on branch v5.0.x (TST: Fix devdeps job)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extra CI Run cron CI as part of PR io.ascii no-changelog-entry-needed numpy-dev table 💤 backport-v5.0.x on-merge: backport to v5.0.x 💤 backport-v5.2.x on-merge: backport to v5.2.x 💤 merge-when-ci-passes Do not use: We have auto-merge option now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: numpy.str does not exist in numpy 1.25.0.dev
5 participants