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

build: pandas min version #16308

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nstarman
Copy link
Member

Copy link

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • 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 instructions for rebase and squash.
  • 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?
  • 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 the backport-v6.1.x on-merge: backport to v6.1.x label Apr 18, 2024
@pllim pllim modified the milestones: v6.0.2, v6.1.1 Apr 18, 2024
Copy link
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

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

With v6.1rc out, we don't backport to v6.0.x anymore, so I adjusted the milestone. FYI.

Also, need to update this:

oldestdeps: pandas==1.4.*

@pllim
Copy link
Member

pllim commented Apr 18, 2024

Actually the tox.ini setup suggested that we are supposed to support pandas>=1.4 so maybe we should not backport this.

@pllim pllim modified the milestones: v6.1.1, v7.0.0 Apr 18, 2024
@pllim pllim removed the backport-v6.1.x on-merge: backport to v6.1.x label Apr 18, 2024
@nstarman
Copy link
Member Author

It would be nice if we could tie oldest-deps in tox to our pyproject.

@pllim
Copy link
Member

pllim commented Apr 18, 2024

It would be nice if we could tie oldest-deps in tox to our pyproject.

@WilliamJamieson might have wrote something up for such things at one point but I don't remember where. I vaguely remember @jdavies-st had ideas too. 🤞

@pllim
Copy link
Member

pllim commented Apr 18, 2024

From a quick grep, we also don't need this anymore:

__doctest_requires__ = {"*pandas": ["pandas>=1.1"]}

Also the blurb about "Version 0.14" in docs/install.rst under pandas.

Maybe can also get rid of this but @taldcroft should confirm:

astropy/astropy/table/table.py

Lines 4147 to 4154 in 7542bc9

# If pandas is older than 0.24 the type may have turned to float
if column.dtype.kind != out[name].dtype.kind:
warnings.warn(
f"converted column '{name}' from {column.dtype} to"
f" {out[name].dtype}",
TableReplaceWarning,
stacklevel=3,
)

@jdavies-st
Copy link
Contributor

It would be nice if we could tie oldest-deps in tox to our pyproject.

@WilliamJamieson might have wrote something up for such things at one point but I don't remember where. I vaguely remember @jdavies-st had ideas too. 🤞

https://github.com/spacetelescope/minimum_dependencies is the package you want. It was originally a script within jwst, but William pulled it out into its own package. It parses the minimum versions of packages specified in pyproject.toml and then writes out a requirements.txt file with these versions pinned. The CI job can then install these versions first, then the package without deps, and see whether the tests pass.

@nstarman
Copy link
Member Author

nstarman commented Apr 22, 2024

Thanks @jdavies-st! Perfect for a follow up PR simplifying our tox.ini.

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.

Fine for table

@pllim
Copy link
Member

pllim commented Apr 24, 2024

But @taldcroft , can we remove the snippet mentioned here?

#16308 (comment)

@taldcroft
Copy link
Member

But @taldcroft , can we remove the snippet mentioned here?

#16308 (comment)

Yes, that can go since pandas >= 0.24 is always true. The one thing is that this removes the warning if the user specifies use_nullable_int = False in the call to to_pandas(). I think this is reasonable and a good thing -- the user should not to be warned about something they specifically opted into. The doc strings needs to be updated.

        use_nullable_int : bool, default=True
            Convert integer MaskedColumn to pandas nullable integer type.
            If ``use_nullable_int=False`` and there are masked elements then
            the column is converted to float with NaN for missing elements.

This is a minor API change but a good cleanup for 7.0. In a perfect world this change will break a test (for the warning) but I'm not sure off-hand.

@nstarman
Copy link
Member Author

pre-commit autofix

@nstarman nstarman requested a review from taldcroft April 25, 2024 15:21
@nstarman
Copy link
Member Author

pre-commit.ci autofix

@nstarman
Copy link
Member Author

Hm. Appears that pandas v1.5.3 doesn't raise the same error as later versions, instead emitting a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

4 participants