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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ jobs:
types-setuptools \
setuptools \
polars
- name: Install pandera
run: python -m pip install -e .
- name: Pip info
run: python -m pip list

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def linkcode_resolve(domain, info):
# docsearch configuration
docsearch_container = "#docsearch"
docsearch_app_id = os.getenv("DOCSEARCH_SEARCH_APP_ID", "GA9NROLUXR")
docsearch_api_key = os.getenv("DOCSEARCH_SEARCH_API_KEY")
docsearch_api_key = os.getenv("DOCSEARCH_SEARCH_API_KEY", "<PLACEHOLDER>")
docsearch_index_name = os.getenv("DOCSEARCH_INDEX_NAME", "pandera")
docsearch_search_parameters = {
"facetFilters": [f"version:{os.getenv('READTHEDOCS_VERSION', 'stable')}"]
Expand Down
8 changes: 5 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ dependencies:
# pandera dependencies
- packaging >= 20.0
- hypothesis >= 6.92.7
- numpy >= 1.24.4
- pandas >= 2.1.1
- scipy
- pyyaml >= 5.1
- typing_inspect >= 0.6.0
- typing_extensions >= 3.7.4.3
- frictionless <= 4.40.8 # v5.* introduces breaking changes
- pyarrow
- pydantic

# hypotheses extra
- scipy

# mypy extra
- pandas-stubs

Expand All @@ -43,6 +43,8 @@ dependencies:
- black >= 24.0

# testing
- numpy >= 1.24.4
- pandas >= 2.1.1
- isort >= 5.7.0
- joblib
- mypy = 1.10.0
Expand Down
1 change: 1 addition & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ def _install_extras(
"--upgrade",
*_get_pinned_requirements(session, pandas, pydantic, extra),
)
session.run("uv", "pip", "install", ".")


@nox.session
Expand Down
165 changes: 10 additions & 155 deletions pandera/__init__.py
Original file line number Diff line number Diff line change
@@ -1,162 +1,17 @@
# pylint: disable=wrong-import-position
"""A flexible and expressive pandas validation library."""
"""A flexible and expressive dataframe validation library."""

import os
import platform
import sys

from pandera._patch_numpy2 import _patch_numpy2
from pandera._version import __version__

_patch_numpy2()
try:
import pandas as pd
except ImportError:
sys.exit(0)

import pandera.backends
import pandera.backends.base.builtin_checks
import pandera.backends.base.builtin_hypotheses
import pandera.backends.pandas
from pandera import errors, external_config
from pandera.api import extensions
from pandera.api.checks import Check
from pandera.api.dataframe.model_components import (
Field,
check,
dataframe_check,
dataframe_parser,
parser,
)
from pandera.api.hypotheses import Hypothesis
from pandera.api.pandas.array import SeriesSchema
from pandera.api.pandas.components import Column, Index, MultiIndex
from pandera.api.pandas.container import DataFrameSchema
from pandera.api.pandas.model import DataFrameModel
from pandera.api.parsers import Parser
from pandera.decorators import check_input, check_io, check_output, check_types
from pandera.dtypes import (
Bool,
Category,
Complex,
Complex64,
Complex128,
DataType,
Date,
DateTime,
Decimal,
Float,
Float16,
Float32,
Float64,
Int,
Int8,
Int16,
Int32,
Int64,
String,
Timedelta,
Timestamp,
UInt,
UInt8,
UInt16,
UInt32,
UInt64,
)
from pandera.engines.numpy_engine import Object
from pandera.engines.pandas_engine import (
BOOL,
INT8,
INT16,
INT32,
INT64,
PANDAS_1_2_0_PLUS,
PANDAS_1_3_0_PLUS,
PANDAS_2_0_0_PLUS,
STRING,
UINT8,
UINT16,
UINT32,
UINT64,
pandas_version,
)
from pandera.schema_inference.pandas import infer_schema
from pandera.version import __version__

if platform.system() != "Windows":
# pylint: disable=ungrouped-imports
from pandera.dtypes import Complex256, Float128
from pandera.pandas import *
from pandera.pandas import __all__


__all__ = [
# dtypes
"Bool",
"Category",
"Complex",
"Complex64",
"Complex128",
"Complex256",
"Date",
"DataType",
"DateTime",
"Float",
"Float16",
"Float32",
"Float64",
"Float128",
"Int",
"Int8",
"Int16",
"Int32",
"Int64",
"String",
"Timedelta",
"Timestamp",
"UInt",
"UInt8",
"UInt16",
"UInt32",
"UInt64",
# numpy_engine
"Object",
# pandas_engine
"BOOL",
"INT8",
"INT16",
"INT32",
"INT64",
"PANDAS_1_2_0_PLUS",
"PANDAS_1_3_0_PLUS",
"PANDAS_2_0_0_PLUS",
"STRING",
"UINT8",
"UINT16",
"UINT32",
"UINT64",
# pandera.engines.pandas_engine
"pandas_version",
# checks
"Check",
# parsers
"Parser",
# decorators
"check_input",
"check_io",
"check_output",
"check_types",
# hypotheses
"Hypothesis",
# model
"DataFrameModel",
# model_components
"Field",
"check",
"dataframe_check",
"parser",
"dataframe_parser",
# schema_components
"Column",
"Index",
"MultiIndex",
# schema_inference
"infer_schema",
# schemas
"DataFrameSchema",
"SeriesSchema",
# version
"__version__",
]
__all__.append("__version__")
Loading