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

Type-check Pandas code and require newer pyarrow. #201

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

thetorpedodog
Copy link
Contributor

  • Pandas now has canonical type stubs, which mypy can find and install.
  • We no longer support py3.7, so we don't need the pyarrow hotfix.
  • Type annotation fix related to installing Pandas stubs.

Copy link
Member

@johnkerl johnkerl left a comment

Choose a reason for hiding this comment

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

We no longer support py3.7, so we don't need the pyarrow hotfix.

@thetorpedodog this is a longer story -- we don't need the hotfix as long as we've got pyarrow >= 14

But here is the current status on that, which is not done yet:

This is confusing, so to be extra-clear here:

TL;DR -- we need pyarrow-hotfix for now. And I'll deal with this, once all the above issues are resolved, on single-cell-data/TileDB-SOMA#1926

@@ -16,12 +16,9 @@ dependencies = [
"numba",
"numpy>=1.21",
"pandas",
"pyarrow",
# TODO: once we no longer support Python 3.7, remove this and pin to pyarrow >= 14.0.1
Copy link
Member

Choose a reason for hiding this comment

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

Following on from my review comment: let's keep pyarrow-hotfix and update the reason-why-it-is-needed comment (which has gone stale)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pyarrow-hotfix has been restored.

@thetorpedodog
Copy link
Contributor Author

To do this, I (after some trial and error):

  1. Removed all the entries from the [[tool.mypy.overrides]] module = [...] setting, so that mypy would no longer ignore any modules
  2. Ran update-requirements-txt to rebuild the requirements files.
  3. Looked at the mypy output from update-requirements-txt and re-enabled ignoring modules that had no type stubs (and also fixed any issues that arose).

- Pandas now has canonical type stubs, which mypy can find and install.
- Type annotation fix related to installing Pandas stubs.
- Update commentary on why we still use pyarrow-hotfix.
@thetorpedodog thetorpedodog merged commit 7c9abe6 into main Jun 17, 2024
7 checks passed
@thetorpedodog thetorpedodog deleted the add-pandas-stubs branch June 17, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants