Skip to content

CLN: random state updates after dropping numpy 1.17 #42407

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 6, 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
16 changes: 7 additions & 9 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,13 @@
Frequency = Union[str, "DateOffset"]
Axes = Collection[Any]

# BitGenerator isn't exposed until 1.18
if TYPE_CHECKING:
RandomState = Union[
int,
ArrayLike,
np.random.Generator,
np.random.BitGenerator,
np.random.RandomState,
]
RandomState = Union[
int,
ArrayLike,
np.random.Generator,
np.random.BitGenerator,
np.random.RandomState,
]

# dtypes
NpDtype = Union[str, np.dtype]
Expand Down
4 changes: 1 addition & 3 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
AnyArrayLike,
ArrayLike,
NpDtype,
RandomState,
Scalar,
T,
)
Expand All @@ -52,9 +53,6 @@
from pandas.core.dtypes.missing import isna

if TYPE_CHECKING:
# Includes BitGenerator, which only exists >= 1.18
from pandas._typing import RandomState

from pandas import Index


Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
JSONSerializable,
Level,
Manager,
RandomState,
Renamer,
StorageOptions,
T,
Expand Down Expand Up @@ -157,7 +158,6 @@
if TYPE_CHECKING:

from pandas._libs.tslibs import BaseOffset
from pandas._typing import RandomState

from pandas.core.frame import DataFrame
from pandas.core.resample import Resampler
Expand Down
6 changes: 1 addition & 5 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class providing the base-class of operations.
from textwrap import dedent
import types
from typing import (
TYPE_CHECKING,
Callable,
Hashable,
Iterable,
Expand Down Expand Up @@ -47,6 +46,7 @@ class providing the base-class of operations.
F,
FrameOrSeries,
IndexLabel,
RandomState,
Scalar,
T,
final,
Expand Down Expand Up @@ -109,10 +109,6 @@ class providing the base-class of operations.
maybe_use_numba,
)

if TYPE_CHECKING:

from pandas._typing import RandomState

_common_see_also = """
See Also
--------
Expand Down