Skip to content

Commit ef84fed

Browse files
committed
Merge to pass CI test
GH PR pandas-dev#42413 Merge branch 'master' into 41457-upgrade-to-bootstrap5
2 parents 28c17c7 + a69603d commit ef84fed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+179
-173
lines changed

.github/workflows/ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
pull_request:
88
branches:
99
- master
10-
- 1.2.x
1110
- 1.3.x
1211

1312
env:

.github/workflows/database.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
pull_request:
88
branches:
99
- master
10-
- 1.2.x
1110
- 1.3.x
1211
paths-ignore:
1312
- "doc/**"

.github/workflows/posix.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
pull_request:
88
branches:
99
- master
10-
- 1.2.x
1110
- 1.3.x
1211
paths-ignore:
1312
- "doc/**"

.github/workflows/python-dev.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- 1.3.x
78
pull_request:
89
branches:
910
- master

.github/workflows/sdist.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
pull_request:
88
branches:
99
- master
10-
- 1.2.x
1110
- 1.3.x
1211
paths-ignore:
1312
- "doc/**"

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ repos:
6060
rev: v2.20.0
6161
hooks:
6262
- id: pyupgrade
63-
args: [--py37-plus]
63+
args: [--py38-plus]
6464
- repo: https://github.com/pre-commit/pygrep-hooks
6565
rev: v1.9.0
6666
hooks:

asv_bench/benchmarks/rolling.py

+3
Original file line numberDiff line numberDiff line change
@@ -296,5 +296,8 @@ def time_apply(self, method):
296296
table_method_func, raw=True, engine="numba"
297297
)
298298

299+
def time_ewm_mean(self, method):
300+
self.df.ewm(1, method=method).mean(engine="numba")
301+
299302

300303
from .pandas_vb_common import setup # noqa: F401 isort:skip

azure-pipelines.yml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ trigger:
33
branches:
44
include:
55
- master
6-
- 1.2.x
76
- 1.3.x
87
paths:
98
exclude:

doc/source/getting_started/install.rst

-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ Visualization
262262
========================= ================== =============================================================
263263
Dependency Minimum Version Notes
264264
========================= ================== =============================================================
265-
setuptools 38.6.0 Utils for entry points of plotting backend
266265
matplotlib 3.3.2 Plotting library
267266
Jinja2 2.11 Conditional formatting with DataFrame.style
268267
tabulate 0.8.7 Printing in Markdown-friendly format (see `tabulate`_)

doc/source/whatsnew/v1.4.0.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ enhancement2
3030
Other enhancements
3131
^^^^^^^^^^^^^^^^^^
3232
- :meth:`Series.sample`, :meth:`DataFrame.sample`, and :meth:`.GroupBy.sample` now accept a ``np.random.Generator`` as input to ``random_state``. A generator will be more performant, especially with ``replace=False`` (:issue:`38100`)
33+
- :meth:`Series.ewm`, :meth:`DataFrame.ewm`, now support a ``method`` argument with a ``'table'`` option that performs the windowing operation over an entire :class:`DataFrame`. See :ref:`Window Overview <window.overview>` for performance and functional benefits (:issue:`42273`)
3334
-
3435

3536
.. ---------------------------------------------------------------------------
@@ -82,8 +83,6 @@ If installed, we now require:
8283
+-----------------+-----------------+----------+---------+
8384
| mypy (dev) | 0.910 | | X |
8485
+-----------------+-----------------+----------+---------+
85-
| setuptools | 38.6.0 | | |
86-
+-----------------+-----------------+----------+---------+
8786

8887
For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
8988
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.

pandas/__init__.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
del hard_dependencies, dependency, missing_dependencies
2020

2121
# numpy compat
22-
from pandas.compat import (
23-
np_version_under1p18 as _np_version_under1p18,
24-
is_numpy_dev as _is_numpy_dev,
25-
)
22+
from pandas.compat import is_numpy_dev as _is_numpy_dev
2623

2724
try:
2825
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib

pandas/_typing.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
Dict,
2222
Hashable,
2323
List,
24+
Literal,
2425
Mapping,
2526
Optional,
2627
Sequence,
@@ -37,7 +38,6 @@
3738
# https://mypy.readthedocs.io/en/latest/common_issues.html#import-cycles
3839
if TYPE_CHECKING:
3940
from typing import (
40-
Literal,
4141
TypedDict,
4242
final,
4343
)
@@ -200,10 +200,7 @@
200200
]
201201

202202
# Arguments for fillna()
203-
if TYPE_CHECKING:
204-
FillnaOptions = Literal["backfill", "bfill", "ffill", "pad"]
205-
else:
206-
FillnaOptions = str
203+
FillnaOptions = Literal["backfill", "bfill", "ffill", "pad"]
207204

208205
# internals
209206
Manager = Union[

pandas/compat/__init__.py

-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
is_numpy_dev,
1717
np_array_datetime64_compat,
1818
np_datetime64_compat,
19-
np_version_under1p18,
2019
np_version_under1p19,
2120
np_version_under1p20,
2221
)
@@ -27,7 +26,6 @@
2726
pa_version_under4p0,
2827
)
2928

30-
PY38 = sys.version_info >= (3, 8)
3129
PY39 = sys.version_info >= (3, 9)
3230
PY310 = sys.version_info >= (3, 10)
3331
PYPY = platform.python_implementation() == "PyPy"
@@ -151,7 +149,6 @@ def get_lzma_file(lzma):
151149
"is_numpy_dev",
152150
"np_array_datetime64_compat",
153151
"np_datetime64_compat",
154-
"np_version_under1p18",
155152
"np_version_under1p19",
156153
"np_version_under1p20",
157154
"pa_version_under1p0",

pandas/compat/numpy/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# numpy versioning
1010
_np_version = np.__version__
1111
_nlv = Version(_np_version)
12-
np_version_under1p18 = _nlv < Version("1.18")
1312
np_version_under1p19 = _nlv < Version("1.19")
1413
np_version_under1p20 = _nlv < Version("1.20")
1514
is_numpy_dev = _nlv.dev is not None

pandas/core/algorithms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from textwrap import dedent
99
from typing import (
1010
TYPE_CHECKING,
11+
Literal,
1112
Union,
1213
cast,
1314
)
@@ -79,7 +80,6 @@
7980
from pandas.core.indexers import validate_indices
8081

8182
if TYPE_CHECKING:
82-
from typing import Literal
8383

8484
from pandas import (
8585
Categorical,

pandas/core/arrays/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Any,
1515
Callable,
1616
Iterator,
17+
Literal,
1718
Sequence,
1819
TypeVar,
1920
cast,
@@ -72,7 +73,6 @@
7273
)
7374

7475
if TYPE_CHECKING:
75-
from typing import Literal
7676

7777
class ExtensionArraySupportsAnyAll("ExtensionArray"):
7878
def any(self, *, skipna: bool = True) -> bool:

pandas/core/arrays/datetimelike.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
TYPE_CHECKING,
1010
Any,
1111
Callable,
12+
Literal,
1213
Sequence,
1314
TypeVar,
1415
Union,
@@ -121,7 +122,6 @@
121122
from pandas.tseries import frequencies
122123

123124
if TYPE_CHECKING:
124-
from typing import Literal
125125

126126
from pandas.core.arrays import (
127127
DatetimeArray,

pandas/core/arrays/datetimes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
)
99
from typing import (
1010
TYPE_CHECKING,
11+
Literal,
1112
cast,
1213
overload,
1314
)
@@ -81,7 +82,6 @@
8182
)
8283

8384
if TYPE_CHECKING:
84-
from typing import Literal
8585

8686
from pandas import DataFrame
8787
from pandas.core.arrays import (

pandas/core/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
Any,
1111
Generic,
1212
Hashable,
13+
Literal,
1314
TypeVar,
1415
cast,
1516
)
@@ -64,7 +65,6 @@
6465
import pandas.core.nanops as nanops
6566

6667
if TYPE_CHECKING:
67-
from typing import Literal
6868

6969
from pandas import Categorical
7070

pandas/core/common.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
Scalar,
3636
T,
3737
)
38-
from pandas.compat import np_version_under1p18
3938

4039
from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
4140
from pandas.core.dtypes.common import (
@@ -433,7 +432,7 @@ def random_state(state: RandomState | None = None):
433432
if (
434433
is_integer(state)
435434
or is_array_like(state)
436-
or (not np_version_under1p18 and isinstance(state, np.random.BitGenerator))
435+
or isinstance(state, np.random.BitGenerator)
437436
):
438437
# error: Argument 1 to "RandomState" has incompatible type "Optional[Union[int,
439438
# Union[ExtensionArray, ndarray[Any, Any]], Generator, RandomState]]"; expected

pandas/core/dtypes/cast.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from typing import (
1515
TYPE_CHECKING,
1616
Any,
17+
Literal,
1718
Sized,
1819
TypeVar,
1920
cast,
@@ -93,7 +94,6 @@
9394
)
9495

9596
if TYPE_CHECKING:
96-
from typing import Literal
9797

9898
from pandas.core.arrays import (
9999
DatetimeArray,

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
Hashable,
2828
Iterable,
2929
Iterator,
30+
Literal,
3031
Sequence,
3132
cast,
3233
overload,
@@ -207,7 +208,6 @@
207208
import pandas.plotting
208209

209210
if TYPE_CHECKING:
210-
from typing import Literal
211211

212212
from pandas._typing import (
213213
TimedeltaConvertibleTypes,

pandas/core/generic.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
AnyStr,
1515
Callable,
1616
Hashable,
17+
Literal,
1718
Mapping,
1819
Sequence,
1920
cast,
@@ -154,7 +155,6 @@
154155
from pandas.io.formats.printing import pprint_thing
155156

156157
if TYPE_CHECKING:
157-
from typing import Literal
158158

159159
from pandas._libs.tslibs import BaseOffset
160160
from pandas._typing import RandomState
@@ -10846,6 +10846,7 @@ def ewm(
1084610846
ignore_na: bool_t = False,
1084710847
axis: Axis = 0,
1084810848
times: str | np.ndarray | FrameOrSeries | None = None,
10849+
method: str = "single",
1084910850
) -> ExponentialMovingWindow:
1085010851
axis = self._get_axis_number(axis)
1085110852
# error: Value of type variable "FrameOrSeries" of "ExponentialMovingWindow"
@@ -10861,6 +10862,7 @@ def ewm(
1086110862
ignore_na=ignore_na,
1086210863
axis=axis,
1086310864
times=times,
10865+
method=method,
1086410866
)
1086510867

1086610868
# ----------------------------------------------------------------------

pandas/core/groupby/generic.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,8 @@ def _transform_general(self, func, *args, **kwargs):
13091309
fast_path, slow_path = self._define_paths(func, *args, **kwargs)
13101310

13111311
for name, group in gen:
1312+
if group.size == 0:
1313+
continue
13121314
object.__setattr__(group, "name", name)
13131315

13141316
# Try slow path and fast path.
@@ -1325,9 +1327,7 @@ def _transform_general(self, func, *args, **kwargs):
13251327
# we need to broadcast across the
13261328
# other dimension; this will preserve dtypes
13271329
# GH14457
1328-
if not np.prod(group.shape):
1329-
continue
1330-
elif res.index.is_(obj.index):
1330+
if res.index.is_(obj.index):
13311331
r = concat([res] * len(group.columns), axis=1)
13321332
r.columns = group.columns
13331333
r.index = group.index

pandas/core/groupby/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class providing the base-class of operations.
2424
Iterable,
2525
Iterator,
2626
List,
27+
Literal,
2728
Mapping,
2829
Sequence,
2930
TypeVar,
@@ -109,7 +110,6 @@ class providing the base-class of operations.
109110
)
110111

111112
if TYPE_CHECKING:
112-
from typing import Literal
113113

114114
from pandas._typing import RandomState
115115

pandas/core/indexes/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Any,
1010
Callable,
1111
Hashable,
12+
Literal,
1213
Sequence,
1314
TypeVar,
1415
cast,
@@ -159,7 +160,6 @@
159160
)
160161

161162
if TYPE_CHECKING:
162-
from typing import Literal
163163

164164
from pandas import (
165165
CategoricalIndex,

pandas/core/resample.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from datetime import timedelta
55
from textwrap import dedent
66
from typing import (
7-
TYPE_CHECKING,
87
Callable,
98
Hashable,
9+
Literal,
1010
no_type_check,
1111
)
1212

@@ -88,9 +88,6 @@
8888
Tick,
8989
)
9090

91-
if TYPE_CHECKING:
92-
from typing import Literal
93-
9491
_shared_docs_kwargs: dict[str, str] = {}
9592

9693

0 commit comments

Comments
 (0)