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

Pandas dependency deprecation future warning, add pandera[pandas] extra #1926

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

Conversation

cosmicBboy
Copy link
Collaborator

@cosmicBboy cosmicBboy commented Mar 3, 2025

Fixes #1847

This PR is laying the groundwork for an eventual deprecation of the top-level pandera module to access the pandas validation objects, like schemas, models, types, etc:

  • The pandas and numpy dependencies have been removed from pandera's core dependencies.
  • The top-level module imports for these symbols have been moved to pandera.pandas.
  • Minimum pandas and numpy versions (2.1.1, 1.24.4 respectively) are enforced at import time

pandera will import from pandera.pandas import * so as to maintain backwards compatibility. The deprecation date for removing this import is TBD. I'll follow-up with additional PRs to update docs and tests to use import pandera.pandas as pa as the recommended way of defining pandas dataframe schemas.

This PR also adds a pandas extra so that users have to explicitly have pandas installed in their environment to use pandera's pandas data validation objects.

⚠️ Breaking Change

If you relied on pandera to install pandas in your environment (which I guess could happen, but would be strange), you will now have to install pandas separately:

pip install pandas pandera

Or

pip install "pandera[pandas]"

Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
Signed-off-by: cosmicBboy <niels.bantilan@gmail.com>
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.

Decouple pandera and pandas when using it with polars
1 participant