Skip to content

Commit 687a41b

Browse files
Merge remote-tracking branch 'upstream/main' into bisect
2 parents 7b1b684 + 413ed0c commit 687a41b

Some content is hidden

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

54 files changed

+837
-717
lines changed

.github/workflows/posix.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ jobs:
2525
strategy:
2626
matrix:
2727
settings: [
28-
[actions-38-downstream_compat.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
29-
[actions-38-minimum_versions.yaml, "not clipboard", "", "", "", "", ""],
30-
[actions-38.yaml, "not slow and not network", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""],
31-
[actions-38.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""],
32-
[actions-38.yaml, "not clipboard", "", "", "", "", ""],
33-
[actions-pypy-38.yaml, "not slow and not clipboard", "", "", "", "", "--max-worker-restart 0"],
34-
[actions-39.yaml, "not clipboard", "", "", "", "", ""],
35-
[actions-310-numpydev.yaml, "not slow and not network", "xsel", "", "", "deprecate", "-W error"],
36-
[actions-310.yaml, "not clipboard", "", "", "", "", ""],
28+
[actions-38-downstream_compat.yaml, "not slow and not network", "", "", "", "", ""],
29+
[actions-38-minimum_versions.yaml, "", "", "", "", "", ""],
30+
[actions-38.yaml, "not slow and not network", "language-pack-it", "it_IT.utf8", "it_IT.utf8", "", ""],
31+
[actions-38.yaml, "not slow and not network", "language-pack-zh-hans", "zh_CN.utf8", "zh_CN.utf8", "", ""],
32+
[actions-38.yaml, "", "", "", "", "", ""],
33+
[actions-pypy-38.yaml, "not slow", "", "", "", "", "--max-worker-restart 0"],
34+
[actions-39.yaml, "", "", "", "", "", ""],
35+
[actions-310-numpydev.yaml, "not slow and not network", "", "", "", "deprecate", "-W error"],
36+
[actions-310.yaml, "", "", "", "", "", ""],
3737
]
3838
fail-fast: false
3939
env:
@@ -105,7 +105,8 @@ jobs:
105105
hashFiles('${{ env.ENV_FILE }}') }}
106106

107107
- name: Extra installs
108-
run: sudo apt-get update && sudo apt-get install -y libc6-dev-i386 ${{ env.EXTRA_APT }}
108+
# xsel for clipboard tests
109+
run: sudo apt-get update && sudo apt-get install -y libc6-dev-i386 xsel ${{ env.EXTRA_APT }}
109110

110111
- uses: conda-incubator/setup-miniconda@v2
111112
with:

asv_bench/benchmarks/frame_ctor.py

+23
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import pandas as pd
44
from pandas import (
5+
NA,
56
Categorical,
67
DataFrame,
8+
Float64Dtype,
79
MultiIndex,
810
Series,
911
Timestamp,
@@ -138,6 +140,27 @@ def time_frame_from_range(self):
138140
self.df = DataFrame(self.data)
139141

140142

143+
class FromScalar:
144+
def setup(self):
145+
self.nrows = 100_000
146+
147+
def time_frame_from_scalar_ea_float64(self):
148+
DataFrame(
149+
1.0,
150+
index=range(self.nrows),
151+
columns=list("abc"),
152+
dtype=Float64Dtype(),
153+
)
154+
155+
def time_frame_from_scalar_ea_float64_na(self):
156+
DataFrame(
157+
NA,
158+
index=range(self.nrows),
159+
columns=list("abc"),
160+
dtype=Float64Dtype(),
161+
)
162+
163+
141164
class FromArrays:
142165

143166
goal_time = 0.2

asv_bench/benchmarks/join_merge.py

+6
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ def time_merge_dataframe_integer_2key(self, sort):
216216
def time_merge_dataframe_integer_key(self, sort):
217217
merge(self.df, self.df2, on="key1", sort=sort)
218218

219+
def time_merge_dataframe_empty_right(self, sort):
220+
merge(self.left, self.right.iloc[:0], sort=sort)
221+
222+
def time_merge_dataframe_empty_left(self, sort):
223+
merge(self.left.iloc[:0], self.right, sort=sort)
224+
219225
def time_merge_dataframes_cross(self, sort):
220226
merge(self.left.loc[:2000], self.right.loc[:2000], how="cross", sort=sort)
221227

azure-pipelines.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pr:
1818
variables:
1919
PYTEST_WORKERS: auto
2020
PYTEST_TARGET: pandas
21+
PATTERN: "not slow and not high_memory and not db and not network"
22+
PANDAS_CI: 1
2123

2224
jobs:
2325
# Mac and Linux use the same template

ci/azure/windows.yml

+8-37
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,22 @@ parameters:
44

55
jobs:
66
- job: ${{ parameters.name }}
7+
timeoutInMinutes: 90
78
pool:
89
vmImage: ${{ parameters.vmImage }}
910
strategy:
1011
matrix:
11-
py38_np18_1:
12-
ENV_FILE: ci/deps/azure-windows-38.yaml
12+
py38:
13+
ENV_FILE: ci/deps/actions-38.yaml
1314
CONDA_PY: "38"
14-
PATTERN: "not slow"
15-
PYTEST_WORKERS: 2 # GH-42236
16-
PYTEST_TARGET: "pandas/tests/[a-h]*"
1715

18-
py38_np18_2:
19-
ENV_FILE: ci/deps/azure-windows-38.yaml
20-
CONDA_PY: "38"
21-
PATTERN: "not slow"
22-
PYTEST_WORKERS: 2 # GH-42236
23-
PYTEST_TARGET: "pandas/tests/[i-z]*"
24-
25-
py39_1:
26-
ENV_FILE: ci/deps/azure-windows-39.yaml
27-
CONDA_PY: "39"
28-
PATTERN: "not slow and not high_memory"
29-
PYTEST_WORKERS: 2 # GH-42236
30-
PYTEST_TARGET: "pandas/tests/[a-h]*"
31-
32-
py39_2:
33-
ENV_FILE: ci/deps/azure-windows-39.yaml
16+
py39:
17+
ENV_FILE: ci/deps/actions-39.yaml
3418
CONDA_PY: "39"
35-
PATTERN: "not slow and not high_memory"
36-
PYTEST_WORKERS: 2 # GH-42236
37-
PYTEST_TARGET: "pandas/tests/[i-z]*"
38-
39-
py310_1:
40-
ENV_FILE: ci/deps/azure-windows-310.yaml
41-
CONDA_PY: "310"
42-
PATTERN: "not slow and not high_memory"
43-
PYTEST_WORKERS: 2 # GH-42236
44-
PYTEST_TARGET: "pandas/tests/[a-h]*"
4519

46-
py310_2:
47-
ENV_FILE: ci/deps/azure-windows-310.yaml
20+
py310:
21+
ENV_FILE: ci/deps/actions-310.yaml
4822
CONDA_PY: "310"
49-
PATTERN: "not slow and not high_memory"
50-
PYTEST_WORKERS: 2 # GH-42236
51-
PYTEST_TARGET: "pandas/tests/[i-z]*"
5223

5324
steps:
5425
- powershell: |
@@ -59,7 +30,7 @@ jobs:
5930
displayName: 'Update conda'
6031

6132
- bash: |
62-
conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
33+
conda env create -q --file ci\\deps\\actions-$(CONDA_PY).yaml
6334
displayName: 'Create anaconda environment'
6435
- bash: |
6536
source activate pandas-dev

ci/deps/azure-windows-310.yaml

-41
This file was deleted.

ci/deps/azure-windows-38.yaml

-35
This file was deleted.

ci/deps/azure-windows-39.yaml

-40
This file was deleted.

ci/run_tests.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ if [[ $(uname) == "Linux" && -z $DISPLAY ]]; then
2424
XVFB="xvfb-run "
2525
fi
2626

27-
PYTEST_CMD="${XVFB}pytest -r fEs -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET"
27+
PYTEST_CMD="${XVFB}pytest -r fEs -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET"
28+
29+
if [[ "$PATTERN" ]]; then
30+
PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\""
31+
fi
2832

2933
if [[ $(uname) != "Linux" && $(uname) != "Darwin" ]]; then
3034
PYTEST_CMD="$PYTEST_CMD --ignore=pandas/tests/plotting/"
@@ -35,7 +39,13 @@ sh -c "$PYTEST_CMD"
3539

3640
if [[ "$PANDAS_DATA_MANAGER" != "array" ]]; then
3741
# The ArrayManager tests should have already been run by PYTEST_CMD if PANDAS_DATA_MANAGER was already set to array
38-
PYTEST_AM_CMD="PANDAS_DATA_MANAGER=array pytest -m \"$PATTERN and arraymanager\" -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE pandas"
42+
PYTEST_AM_CMD="PANDAS_DATA_MANAGER=array pytest -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE pandas"
43+
44+
if [[ "$PATTERN" ]]; then
45+
PYTEST_AM_CMD="$PYTEST_AM_CMD -m \"$PATTERN and arraymanager\""
46+
else
47+
PYTEST_AM_CMD="$PYTEST_AM_CMD -m \"arraymanager\""
48+
fi
3949

4050
echo $PYTEST_AM_CMD
4151
sh -c "$PYTEST_AM_CMD"
5.84 KB
Loading
5.67 KB
Loading
5.36 KB
Loading
6.28 KB
Loading

doc/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@
446446
"pandas-gbq": ("https://pandas-gbq.readthedocs.io/en/latest/", None),
447447
"py": ("https://pylib.readthedocs.io/en/latest/", None),
448448
"python": ("https://docs.python.org/3/", None),
449-
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
449+
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
450450
"statsmodels": ("https://www.statsmodels.org/devel/", None),
451451
"pyarrow": ("https://arrow.apache.org/docs/", None),
452452
}

doc/source/whatsnew/v1.4.1.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Fixed regressions
1616
~~~~~~~~~~~~~~~~~
1717
- Regression in :meth:`Series.mask` with ``inplace=True`` and ``PeriodDtype`` and an incompatible ``other`` coercing to a common dtype instead of raising (:issue:`45546`)
1818
- Regression in :func:`.assert_frame_equal` not respecting ``check_flags=False`` (:issue:`45554`)
19+
- Regression in :meth:`DataFrame.loc.__getitem__` raising ``ValueError`` when indexing on a :class:`MultiIndex` with one level (:issue:`45779`)
1920
- Regression in :meth:`Series.fillna` with ``downcast=False`` incorrectly downcasting ``object`` dtype (:issue:`45603`)
21+
- Regression in :func:`api.types.is_bool_dtype` raising an ``AttributeError`` when evaluating a categorical :class:`Series` (:issue:`45615`)
2022
- Regression in :meth:`DataFrame.iat` setting values leading to not propagating correctly in subsequent lookups (:issue:`45684`)
2123
- Regression when setting values with :meth:`DataFrame.loc` losing :class:`Index` name if :class:`DataFrame` was empty before (:issue:`45621`)
2224
- Regression in :meth:`~Index.join` with overlapping :class:`IntervalIndex` raising an ``InvalidIndexError`` (:issue:`45661`)
@@ -33,7 +35,6 @@ Bug fixes
3335
- Fixed segfault in :meth:`DataFrame.to_json` when dumping tz-aware datetimes in Python 3.10 (:issue:`42130`)
3436
- Stopped emitting unnecessary ``FutureWarning`` in :meth:`DataFrame.sort_values` with sparse columns (:issue:`45618`)
3537
- Fixed window aggregations in :meth:`DataFrame.rolling` and :meth:`Series.rolling` to skip over unused elements (:issue:`45647`)
36-
- Bug in :func:`api.types.is_bool_dtype` was raising an ``AttributeError`` when evaluating a categorical :class:`Series` (:issue:`45615`)
3738
- Fixed builtin highlighters in :class:`.Styler` to be responsive to ``NA`` with nullable dtypes (:issue:`45804`)
3839

3940
.. ---------------------------------------------------------------------------

doc/source/whatsnew/v1.5.0.rst

+3
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ Performance improvements
244244
- Performance improvement in :meth:`DataFrame.duplicated` when subset consists of only one column (:issue:`45236`)
245245
- Performance improvement in :meth:`.GroupBy.transform` when broadcasting values for user-defined functions (:issue:`45708`)
246246
- Performance improvement in :meth:`.GroupBy.transform` for user-defined functions when only a single group exists (:issue:`44977`)
247+
- Performance improvement in :func:`merge` when left and/or right are empty (:issue:`45838`)
248+
- Performance improvement in :class:`DataFrame` and :class:`Series` constructors for extension dtype scalars (:issue:`45854`)
247249
-
248250

249251
.. ---------------------------------------------------------------------------
@@ -318,6 +320,7 @@ Indexing
318320
- Bug in getting a column from a DataFrame with an object-dtype row index with datetime-like values: the resulting Series now preserves the exact object-dtype Index from the parent DataFrame (:issue:`42950`)
319321
- Bug in indexing on a :class:`DatetimeIndex` with a ``np.str_`` key incorrectly raising (:issue:`45580`)
320322
- Bug in :meth:`CategoricalIndex.get_indexer` when index contains ``NaN`` values, resulting in elements that are in target but not present in the index to be mapped to the index of the NaN element, instead of -1 (:issue:`45361`)
323+
- Bug in setting large integer values into :class:`Series` with ``float32`` or ``float16`` dtype incorrectly altering these values instead of coercing to ``float64`` dtype (:issue:`45844`)
321324
-
322325

323326
Missing

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
- pytz
1010

1111
# benchmarks
12-
- asv
12+
- asv < 0.5.0 # 2022-02-08: v0.5.0 > leads to ASV checks running > 3 hours on CI
1313

1414
# building
1515
# The compiler packages are meta-packages and install the correct compiler (activation) packages on the respective platforms.

0 commit comments

Comments
 (0)