Skip to content

Commit 99158b1

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 2abbc57 + 12475e0 commit 99158b1

File tree

300 files changed

+4310
-2578
lines changed

Some content is hidden

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

300 files changed

+4310
-2578
lines changed

.github/workflows/code-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474

7575
- name: Install pyright
7676
# note: keep version in sync with .pre-commit-config.yaml
77-
run: npm install -g pyright@1.1.202
77+
run: npm install -g pyright@1.1.212
7878

7979
- name: Build Pandas
8080
id: build

.github/workflows/datamanger.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
branches:
1010
- main
1111
- 1.4.x
12+
paths-ignore:
13+
- "doc/**"
1214

1315
env:
1416
ENV_FILE: environment.yml

.github/workflows/posix.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ jobs:
2828
[actions-38-downstream_compat.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
2929
[actions-38-minimum_versions.yaml, "slow", "", "", "", "", ""],
3030
[actions-38-minimum_versions.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
31-
[actions-38-locale_slow.yaml, "slow", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""],
31+
[actions-38.yaml, "not slow and not network", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""],
32+
[actions-38.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""],
3233
[actions-38.yaml, "not slow and not clipboard", "", "", "", "", ""],
33-
[actions-38-slow.yaml, "slow", "", "", "", "", ""],
34-
[actions-38-locale.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""],
35-
[actions-39-slow.yaml, "slow", "", "", "", "", ""],
34+
[actions-38.yaml, "slow", "", "", "", "", ""],
3635
[actions-pypy-38.yaml, "not slow and not clipboard", "", "", "", "", "--max-worker-restart 0"],
37-
[actions-39-numpydev.yaml, "not slow and not network", "xsel", "", "", "deprecate", "-W error"],
38-
[actions-39.yaml, "not slow and not clipboard", "", "", "", "", ""]
36+
[actions-39.yaml, "slow", "", "", "", "", ""],
37+
[actions-39.yaml, "not slow and not clipboard", "", "", "", "", ""],
38+
[actions-310-numpydev.yaml, "not slow and not network", "xclip", "", "", "deprecate", "-W error"],
39+
[actions-310.yaml, "not slow and not clipboard", "", "", "", "", ""],
40+
[actions-310.yaml, "slow", "", "", "", "", ""],
3941
]
4042
fail-fast: false
4143
env:

.github/workflows/python-dev.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# This file is purposely frozen(does not run). DO NOT DELETE IT
2+
# Unfreeze(by commentingthe if: false() condition) once the
3+
# next Python Dev version has released beta 1 and both Cython and numpy support it
4+
# After that Python has released, migrate the workflows to the
5+
# posix GHA workflows/Azure pipelines and "freeze" this file by
6+
# uncommenting the if: false() condition
7+
# Feel free to modify this comment as necessary.
8+
19
name: Python Dev
210

311
on:
@@ -21,13 +29,14 @@ env:
2129

2230
jobs:
2331
build:
32+
if: false # Comment this line out to "unfreeze"
2433
runs-on: ${{ matrix.os }}
2534
strategy:
2635
fail-fast: false
2736
matrix:
2837
os: [ubuntu-latest, macOS-latest, windows-latest]
2938

30-
name: actions-310-dev
39+
name: actions-311-dev
3140
timeout-minutes: 80
3241

3342
concurrency:
@@ -43,7 +52,7 @@ jobs:
4352
- name: Set up Python Dev Version
4453
uses: actions/setup-python@v2
4554
with:
46-
python-version: '3.10-dev'
55+
python-version: '3.11-dev'
4756

4857
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
4958
- name: Install dependencies

.github/workflows/stale-pr.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
stale-pr-message: "This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this."
1515
stale-pr-label: "Stale"
1616
exempt-pr-labels: "Needs Review,Blocked,Needs Discussion"
17-
days-before-stale: 30
17+
days-before-issue-stale: -1
18+
days-before-pr-stale: 30
1819
days-before-close: -1
1920
remove-stale-when-updated: false
2021
debug-only: false

.pre-commit-config.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ repos:
8484
pass_filenames: false
8585
types: [python]
8686
stages: [manual]
87-
# note: keep version in sync with .github/workflows/ci.yml
88-
additional_dependencies: ['pyright@1.1.202']
87+
# note: keep version in sync with .github/workflows/code-checks.yml
88+
additional_dependencies: ['pyright@1.1.212']
8989
- repo: local
9090
hooks:
9191
- id: flake8-rst
@@ -188,3 +188,8 @@ repos:
188188
entry: 'pg8000'
189189
files: ^ci/deps
190190
types: [yaml]
191+
- id: validate-min-versions-in-sync
192+
name: Check minimum version of dependencies are aligned
193+
entry: python scripts/validate_min_versions_in_sync.py
194+
language: python
195+
files: ^(ci/deps/actions-.*-minimum_versions\.yaml|pandas/compat/_optional\.py)$

asv_bench/asv.conf.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
// benchmarked
1414
"repo": "..",
1515

16+
// List of branches to benchmark. If not provided, defaults to "master"
17+
// (for git) or "default" (for mercurial).
18+
"branches": ["main"],
19+
1620
// The tool to use to create environments. May be "conda",
1721
// "virtualenv" or other value depending on the plugins in use.
1822
// If missing or the empty string, the tool will be automatically
@@ -25,7 +29,6 @@
2529

2630
// The Pythons you'd like to test against. If not provided, defaults
2731
// to the current version of Python used to run `asv`.
28-
// "pythons": ["2.7", "3.4"],
2932
"pythons": ["3.8"],
3033

3134
// The matrix of dependencies to test. Each key is the name of a

asv_bench/benchmarks/frame_methods.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,9 @@ def time_frame_duplicated(self):
611611
def time_frame_duplicated_wide(self):
612612
self.df2.duplicated()
613613

614+
def time_frame_duplicated_subset(self):
615+
self.df.duplicated(subset=["a"])
616+
614617

615618
class XS:
616619

asv_bench/benchmarks/groupby.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,12 @@ def setup(self):
735735
data = DataFrame(arr, index=index, columns=["col1", "col20", "col3"])
736736
self.df = data
737737

738+
n = 1000
739+
self.df_wide = DataFrame(
740+
np.random.randn(n, n),
741+
index=np.random.choice(range(10), n),
742+
)
743+
738744
n = 20000
739745
self.df1 = DataFrame(
740746
np.random.randint(1, n, (n, 3)), columns=["jim", "joe", "jolie"]
@@ -754,6 +760,9 @@ def time_transform_lambda_max(self):
754760
def time_transform_ufunc_max(self):
755761
self.df.groupby(level="lev1").transform(np.max)
756762

763+
def time_transform_lambda_max_wide(self):
764+
self.df_wide.groupby(level=0).transform(lambda x: np.max(x, axis=0))
765+
757766
def time_transform_multi_key1(self):
758767
self.df1.groupby(["jim", "joe"])["jolie"].transform("max")
759768

asv_bench/benchmarks/index_cached_properties.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ def time_values(self, index_type):
5656
def time_shape(self, index_type):
5757
self.idx.shape
5858

59-
def time_is_monotonic(self, index_type):
60-
self.idx.is_monotonic
61-
6259
def time_is_monotonic_decreasing(self, index_type):
6360
self.idx.is_monotonic_decreasing
6461

asv_bench/benchmarks/multiindex_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def time_get_indexer_and_pad(self):
112112
self.mi_int.get_indexer(self.other_mi_many_mismatches, method="pad")
113113

114114
def time_is_monotonic(self):
115-
self.mi_int.is_monotonic
115+
self.mi_int.is_monotonic_increasing
116116

117117

118118
class Duplicated:

asv_bench/benchmarks/series_methods.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import numpy as np
44

55
from pandas import (
6+
Index,
67
NaT,
78
Series,
89
date_range,
@@ -12,20 +13,23 @@
1213

1314

1415
class SeriesConstructor:
15-
16-
params = [None, "dict"]
17-
param_names = ["data"]
18-
19-
def setup(self, data):
16+
def setup(self):
2017
self.idx = date_range(
2118
start=datetime(2015, 10, 26), end=datetime(2016, 1, 1), freq="50s"
2219
)
23-
dict_data = dict(zip(self.idx, range(len(self.idx))))
24-
self.data = None if data is None else dict_data
20+
self.data = dict(zip(self.idx, range(len(self.idx))))
21+
self.array = np.array([1, 2, 3])
22+
self.idx2 = Index(["a", "b", "c"])
2523

26-
def time_constructor(self, data):
24+
def time_constructor_dict(self):
2725
Series(data=self.data, index=self.idx)
2826

27+
def time_constructor_no_data(self):
28+
Series(data=None, index=self.idx)
29+
30+
def time_constructor_fastpath(self):
31+
Series(self.array, index=self.idx2, name="name", fastpath=True)
32+
2933

3034
class ToFrame:
3135
params = [["int64", "datetime64[ns]", "category", "Int64"], [None, "foo"]]

asv_bench/benchmarks/strings.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
import numpy as np
44

55
from pandas import (
6+
NA,
67
Categorical,
78
DataFrame,
89
Series,
910
)
11+
from pandas.arrays import StringArray
1012

1113
from .pandas_vb_common import tm
1214

@@ -285,3 +287,18 @@ class Iter(Dtypes):
285287
def time_iter(self, dtype):
286288
for i in self.s:
287289
pass
290+
291+
292+
class StringArrayConstruction:
293+
def setup(self):
294+
self.series_arr = tm.rands_array(nchars=10, size=10 ** 5)
295+
self.series_arr_nan = np.concatenate([self.series_arr, np.array([NA] * 1000)])
296+
297+
def time_string_array_construction(self):
298+
StringArray(self.series_arr)
299+
300+
def time_string_array_with_nan_construction(self):
301+
StringArray(self.series_arr_nan)
302+
303+
def peakmem_stringarray_construction(self):
304+
StringArray(self.series_arr)

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trigger:
66
- 1.4.x
77
paths:
88
exclude:
9-
- 'doc/*'
9+
- 'doc/**'
1010

1111
pr:
1212
autoCancel: true

ci/azure/posix.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@ jobs:
1818
CONDA_PY: "38"
1919
PATTERN: "not slow"
2020
PYTEST_TARGET: "pandas/tests/[i-z]*"
21+
py39_macos_1:
22+
ENV_FILE: ci/deps/azure-macos-39.yaml
23+
CONDA_PY: "39"
24+
PATTERN: "not slow"
25+
PYTEST_TARGET: "pandas/tests/[a-h]*"
26+
py39_macos_2:
27+
ENV_FILE: ci/deps/azure-macos-39.yaml
28+
CONDA_PY: "39"
29+
PATTERN: "not slow"
30+
PYTEST_TARGET: "pandas/tests/[i-z]*"
31+
py310_macos_1:
32+
ENV_FILE: ci/deps/azure-macos-310.yaml
33+
CONDA_PY: "310"
34+
PATTERN: "not slow"
35+
PYTEST_TARGET: "pandas/tests/[a-h]*"
36+
py310_macos_2:
37+
ENV_FILE: ci/deps/azure-macos-310.yaml
38+
CONDA_PY: "310"
39+
PATTERN: "not slow"
40+
PYTEST_TARGET: "pandas/tests/[i-z]*"
2141

2242
steps:
2343
- script: echo '##vso[task.prependpath]$(HOME)/miniconda3/bin'

ci/azure/windows.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@ jobs:
3636
PYTEST_WORKERS: 2 # GH-42236
3737
PYTEST_TARGET: "pandas/tests/[i-z]*"
3838

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]*"
45+
46+
py310_2:
47+
ENV_FILE: ci/deps/azure-windows-310.yaml
48+
CONDA_PY: "310"
49+
PATTERN: "not slow and not high_memory"
50+
PYTEST_WORKERS: 2 # GH-42236
51+
PYTEST_TARGET: "pandas/tests/[i-z]*"
52+
3953
steps:
4054
- powershell: |
4155
Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"

ci/deps/actions-39-numpydev.yaml renamed to ci/deps/actions-310-numpydev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pandas-dev
22
channels:
33
- defaults
44
dependencies:
5-
- python=3.9
5+
- python=3.10
66

77
# tools
88
- pytest>=6.0

ci/deps/actions-310.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: pandas-dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.9
6+
7+
# test dependencies
8+
- cython=0.29.24
9+
- pytest>=6.0
10+
- pytest-cov
11+
- pytest-xdist>=1.31
12+
- hypothesis>=5.5.3
13+
- psutil
14+
15+
# required dependencies
16+
- python-dateutil
17+
- numpy
18+
- pytz
19+
20+
# optional dependencies
21+
- beautifulsoup4
22+
- blosc
23+
- bottleneck
24+
- fastparquet
25+
- fsspec
26+
- html5lib
27+
- gcsfs
28+
- jinja2
29+
- lxml
30+
- matplotlib
31+
# TODO: uncomment after numba supports py310
32+
#- numba
33+
- numexpr
34+
- openpyxl
35+
- odfpy
36+
- pandas-gbq
37+
- psycopg2
38+
- pymysql
39+
- pytables
40+
- pyarrow
41+
- pyreadstat
42+
- pyxlsb
43+
- s3fs
44+
- scipy
45+
- sqlalchemy
46+
- tabulate
47+
- xarray
48+
- xlrd
49+
- xlsxwriter
50+
- xlwt
51+
- zstandard

ci/deps/actions-38-locale_slow.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)