Skip to content

TYP/CLN: implicit re-export #42498

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

Merged
merged 1 commit into from
Jul 12, 2021
Merged
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
6 changes: 2 additions & 4 deletions pandas/core/describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
TYPE_CHECKING,
Any,
Callable,
Hashable,
Sequence,
cast,
)
Expand All @@ -21,10 +22,7 @@
import numpy as np

from pandas._libs.tslibs import Timestamp
from pandas._typing import (
FrameOrSeries,
Hashable,
)
from pandas._typing import FrameOrSeries
from pandas.util._validators import validate_percentile

from pandas.core.dtypes.common import (
Expand Down
7 changes: 3 additions & 4 deletions pandas/core/dtypes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from pandas._typing import (
ArrayLike,
DtypeObj,
Optional,
)

from pandas.core.dtypes.base import _registry as registry
Expand Down Expand Up @@ -1406,7 +1405,7 @@ def is_1d_only_ea_obj(obj: Any) -> bool:
)


def is_1d_only_ea_dtype(dtype: Optional[DtypeObj]) -> bool:
def is_1d_only_ea_dtype(dtype: DtypeObj | None) -> bool:
"""
Analogue to is_extension_array_dtype but excluding DatetimeTZDtype.
"""
Expand Down Expand Up @@ -1471,7 +1470,7 @@ def is_extension_array_dtype(arr_or_dtype) -> bool:
return registry.find(dtype) is not None


def is_ea_or_datetimelike_dtype(dtype: Optional[DtypeObj]) -> bool:
def is_ea_or_datetimelike_dtype(dtype: DtypeObj | None) -> bool:
"""
Check for ExtensionDtype, datetime64 dtype, or timedelta64 dtype.

Expand Down Expand Up @@ -1715,7 +1714,7 @@ def _validate_date_like_dtype(dtype) -> None:
)


def validate_all_hashable(*args, error_name: Optional[str] = None) -> None:
def validate_all_hashable(*args, error_name: str | None = None) -> None:
"""
Return None if all args are hashable, else raise a TypeError.

Expand Down
7 changes: 2 additions & 5 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
Scalar,
StorageOptions,
Suffixes,
TimedeltaConvertibleTypes,
TimestampConvertibleTypes,
ValueKeyFunc,
npt,
)
Expand Down Expand Up @@ -209,11 +211,6 @@

if TYPE_CHECKING:

from pandas._typing import (
TimedeltaConvertibleTypes,
TimestampConvertibleTypes,
)

from pandas.core.groupby.generic import DataFrameGroupBy
from pandas.core.resample import Resampler

Expand Down
6 changes: 4 additions & 2 deletions pandas/core/indexers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
"""
from __future__ import annotations

from typing import TYPE_CHECKING
from typing import (
TYPE_CHECKING,
Any,
)
import warnings

import numpy as np

from pandas._typing import (
Any,
AnyArrayLike,
ArrayLike,
)
Expand Down
6 changes: 2 additions & 4 deletions pandas/core/indexes/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import (
TYPE_CHECKING,
Any,
Callable,
Sequence,
TypeVar,
cast,
Expand All @@ -27,10 +28,7 @@
Tick,
parsing,
)
from pandas._typing import (
Callable,
final,
)
from pandas._typing import final
from pandas.compat.numpy import function as nv
from pandas.util._decorators import (
Appender,
Expand Down
7 changes: 2 additions & 5 deletions pandas/core/indexes/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
Timedelta,
to_offset,
)
from pandas._typing import (
DtypeObj,
Optional,
)
from pandas._typing import DtypeObj

from pandas.core.dtypes.common import (
TD64NS_DTYPE,
Expand Down Expand Up @@ -233,7 +230,7 @@ def inferred_type(self) -> str:
def timedelta_range(
start=None,
end=None,
periods: Optional[int] = None,
periods: int | None = None,
freq=None,
name=None,
closed=None,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals/array_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
TYPE_CHECKING,
Any,
Callable,
Hashable,
TypeVar,
)

Expand All @@ -19,7 +20,6 @@
from pandas._typing import (
ArrayLike,
DtypeObj,
Hashable,
)
from pandas.util._validators import validate_bool_kwarg

Expand Down
7 changes: 2 additions & 5 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
IndexKeyFunc,
SingleManager,
StorageOptions,
TimedeltaConvertibleTypes,
TimestampConvertibleTypes,
ValueKeyFunc,
npt,
)
Expand Down Expand Up @@ -142,11 +144,6 @@

if TYPE_CHECKING:

from pandas._typing import (
TimedeltaConvertibleTypes,
TimestampConvertibleTypes,
)

from pandas.core.frame import DataFrame
from pandas.core.groupby.generic import SeriesGroupBy
from pandas.core.resample import Resampler
Expand Down