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

Refactor PandasDtype #490

Merged
merged 16 commits into from
May 24, 2021
Merged
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
- pyyaml >=5.1
- typing_inspect >= 0.6.0
- typing_extensions >= 3.7.4.3
- frictionless

# testing and dependencies
- black >= 20.8b1
Expand Down
3 changes: 3 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ def install_extras(
for spec in REQUIRES[extra].values()
if spec not in ALWAYS_USE_PIP
]
if extra == "core":
specs.append(REQUIRES["all"]["hypothesis"])

session.install(*ALWAYS_USE_PIP)
if (
isinstance(session.virtualenv, nox.virtualenv.CondaEnv)
Expand Down
71 changes: 41 additions & 30 deletions pandera/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,45 @@
"""A flexible and expressive pandas validation library."""
from pandera.dtypes_ import (
Bool,
Category,
Complex,
Complex64,
Complex128,
Complex256,
DataType,
DateTime,
Float,
Float16,
Float32,
Float64,
Float128,
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,
STRING,
UINT8,
UINT16,
UINT32,
UINT64,
)

from . import constants, errors, pandas_accessor
from .checks import Check
Expand All @@ -11,33 +52,3 @@
from .schema_inference import infer_schema
from .schemas import DataFrameSchema, SeriesSchema
from .version import __version__

# pylint: disable=invalid-name
Bool = PandasDtype.Bool
DateTime = PandasDtype.DateTime
Category = PandasDtype.Category
Float = PandasDtype.Float
Float16 = PandasDtype.Float16
Float32 = PandasDtype.Float32
Float64 = PandasDtype.Float64
Int = PandasDtype.Int
Int8 = PandasDtype.Int8
Int16 = PandasDtype.Int16
Int32 = PandasDtype.Int32
Int64 = PandasDtype.Int64
UInt8 = PandasDtype.UInt8
UInt16 = PandasDtype.UInt16
UInt32 = PandasDtype.UInt32
UInt64 = PandasDtype.UInt64
INT8 = PandasDtype.INT8
INT16 = PandasDtype.INT16
INT32 = PandasDtype.INT32
INT64 = PandasDtype.INT64
UINT8 = PandasDtype.UINT8
UINT16 = PandasDtype.UINT16
UINT32 = PandasDtype.UINT32
UINT64 = PandasDtype.UINT64
Object = PandasDtype.Object
String = PandasDtype.String
STRING = PandasDtype.STRING
Timedelta = PandasDtype.Timedelta
Loading