Skip to content

Commit 5c2eb47

Browse files
committed
Merge is necessary because proper changes have been made to a github issue pandas-dev#45608
2 parents edf3d8a + c64fbce commit 5c2eb47

File tree

293 files changed

+5856
-4296
lines changed

Some content is hidden

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

293 files changed

+5856
-4296
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- [ ] closes #xxxx
2-
- [ ] tests added / passed
3-
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
4-
- [ ] whatsnew entry
1+
- [ ] closes #xxxx (Replace xxxx with the Github issue number)
2+
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
3+
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
4+
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

.github/workflows/assign.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ on:
44
types: created
55

66
jobs:
7-
one:
7+
issue_assign:
88
runs-on: ubuntu-latest
99
steps:
1010
- if: github.event.comment.body == 'take'
11-
name:
1211
run: |
1312
echo "Assigning issue ${{ github.event.issue.number }} to ${{ github.event.comment.user.login }}"
1413
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees

.github/workflows/code-checks.yml

+1-1
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 [email protected].202
77+
run: npm install -g [email protected].212
7878

7979
- name: Build Pandas
8080
id: build

.github/workflows/datamanger.yml

+4-8
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
@@ -26,12 +28,9 @@ jobs:
2628
AWS_SECRET_ACCESS_KEY: foobar_secret
2729
ports:
2830
- 5000:5000
29-
strategy:
30-
matrix:
31-
pattern: ["not slow and not network and not clipboard", "slow"]
3231
concurrency:
3332
# https://github.community/t/concurrecy-not-work-for-push/183068/7
34-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-data_manager-${{ matrix.pattern }}
33+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-data_manager
3534
cancel-in-progress: true
3635

3736
steps:
@@ -46,12 +45,9 @@ jobs:
4645
- name: Run tests
4746
env:
4847
PANDAS_DATA_MANAGER: array
49-
PATTERN: ${{ matrix.pattern }}
48+
PATTERN: "not network and not clipboard"
5049
PYTEST_WORKERS: "auto"
5150
PYTEST_TARGET: pandas
5251
run: |
5352
source activate pandas-dev
5453
ci/run_tests.sh
55-
56-
- name: Print skipped tests
57-
run: python ci/print_skipped.py

.github/workflows/docbuild-and-upload.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@ jobs:
4040
- name: Build documentation
4141
run: |
4242
source activate pandas-dev
43-
doc/make.py --warnings-are-errors | tee sphinx.log ; exit ${PIPESTATUS[0]}
44-
45-
# This can be removed when the ipython directive fails when there are errors,
46-
# including the `tee sphinx.log` in te previous step (https://github.com/ipython/ipython/issues/11547)
47-
- name: Check ipython directive errors
48-
run: "! grep -B10 \"^<<<-------------------------------------------------------------------------$\" sphinx.log"
43+
doc/make.py --warnings-are-errors
4944
5045
- name: Install ssh key
5146
run: |

.github/workflows/posix.yml

+6-13
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,14 @@ jobs:
2626
matrix:
2727
settings: [
2828
[actions-38-downstream_compat.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
29-
[actions-38-minimum_versions.yaml, "slow", "", "", "", "", ""],
30-
[actions-38-minimum_versions.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
29+
[actions-38-minimum_versions.yaml, "not clipboard", "", "", "", "", ""],
3130
[actions-38.yaml, "not slow and not network", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""],
3231
[actions-38.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""],
33-
[actions-38.yaml, "not slow and not clipboard", "", "", "", "", ""],
34-
[actions-38.yaml, "slow", "", "", "", "", ""],
32+
[actions-38.yaml, "not clipboard", "", "", "", "", ""],
3533
[actions-pypy-38.yaml, "not slow and not clipboard", "", "", "", "", "--max-worker-restart 0"],
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", "", "", "", "", ""],
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", "", "", "", "", ""],
4137
]
4238
fail-fast: false
4339
env:
@@ -54,7 +50,7 @@ jobs:
5450
COVERAGE: ${{ !contains(matrix.settings[0], 'pypy') }}
5551
concurrency:
5652
# https://github.community/t/concurrecy-not-work-for-push/183068/7
57-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}-${{ matrix.settings[1] }}
53+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}-${{ matrix.settings[1] }}-${{ matrix.settings[2] }}
5854
cancel-in-progress: true
5955

6056
services:
@@ -154,9 +150,6 @@ jobs:
154150
path: test-data.xml
155151
if: failure()
156152

157-
- name: Print skipped tests
158-
run: python ci/print_skipped.py
159-
160153
- name: Upload coverage to Codecov
161154
uses: codecov/codecov-action@v2
162155
with:

.github/workflows/python-dev.yml

-4
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ jobs:
8585
path: test-data.xml
8686
if: failure()
8787

88-
- name: Print skipped tests
89-
run: |
90-
python ci/print_skipped.py
91-
9288
- name: Report Coverage
9389
run: |
9490
coverage report -m

.pre-commit-config.yaml

+2-2
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: ['[email protected].202']
87+
# note: keep version in sync with .github/workflows/code-checks.yml
88+
additional_dependencies: ['[email protected].212']
8989
- repo: local
9090
hooks:
9191
- id: flake8-rst

asv_bench/benchmarks/frame_methods.py

+3
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

+18
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,18 @@ 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+
744+
n = 1_000_000
745+
self.df_tall = DataFrame(
746+
np.random.randn(n, 3),
747+
index=np.random.randint(0, 5, n),
748+
)
749+
738750
n = 20000
739751
self.df1 = DataFrame(
740752
np.random.randint(1, n, (n, 3)), columns=["jim", "joe", "jolie"]
@@ -754,6 +766,12 @@ def time_transform_lambda_max(self):
754766
def time_transform_ufunc_max(self):
755767
self.df.groupby(level="lev1").transform(np.max)
756768

769+
def time_transform_lambda_max_tall(self):
770+
self.df_tall.groupby(level=0).transform(lambda x: np.max(x, axis=0))
771+
772+
def time_transform_lambda_max_wide(self):
773+
self.df_wide.groupby(level=0).transform(lambda x: np.max(x, axis=0))
774+
757775
def time_transform_multi_key1(self):
758776
self.df1.groupby(["jim", "joe"])["jolie"].transform("max")
759777

asv_bench/benchmarks/index_cached_properties.py

-3
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

+1-1
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

+12-8
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"]]

azure-pipelines.yml

+1-1
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

-5
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,3 @@ jobs:
6161
testResultsFiles: 'test-data.xml'
6262
testRunTitle: ${{ format('{0}-$(CONDA_PY)', parameters.name) }}
6363
displayName: 'Publish test results'
64-
65-
- script: |
66-
source activate pandas-dev
67-
python ci/print_skipped.py
68-
displayName: 'Print skipped tests'

ci/azure/windows.yml

-5
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,3 @@ jobs:
7979
testResultsFiles: 'test-data.xml'
8080
testRunTitle: ${{ format('{0}-$(CONDA_PY)', parameters.name) }}
8181
displayName: 'Publish test results'
82-
83-
- bash: |
84-
source activate pandas-dev
85-
python ci/print_skipped.py
86-
displayName: 'Print skipped tests'

ci/deps/actions-310.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pandas-dev
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.9
5+
- python=3.10
66

77
# test dependencies
88
- cython=0.29.24

ci/deps/actions-38-downstream_compat.yaml

+19-15
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,57 @@ channels:
44
- conda-forge
55
dependencies:
66
- python=3.8
7-
- pip
87

98
# test dependencies
10-
- cython>=0.29.24
9+
- cython=0.29.24
1110
- pytest>=6.0
11+
- pytest-cov
1212
- pytest-xdist>=1.31
1313
- hypothesis>=5.5.3
14-
- pytest-cov>=2.10.1 # this is only needed in the coverage build, ref: GH 35737
15-
- nomkl
14+
- psutil
1615

1716
# required dependencies
18-
- numpy
1917
- python-dateutil
18+
- numpy
2019
- pytz
2120

2221
# optional dependencies
2322
- beautifulsoup4
2423
- blosc
25-
- fastparquet>=0.4.0
26-
- fsspec>=0.7.4
27-
- gcsfs
24+
- bottleneck
25+
- fastparquet
26+
- fsspec
2827
- html5lib
28+
- gcsfs
2929
- jinja2
3030
- lxml
3131
- matplotlib
32+
- numba
3233
- numexpr
33-
- odfpy
3434
- openpyxl
35+
- odfpy
3536
- pandas-gbq
3637
- psycopg2
37-
- pyarrow>=1.0.1
3838
- pymysql
3939
- pytables
40+
- pyarrow
41+
- pyreadstat
4042
- pyxlsb
41-
- s3fs>=0.4.0
43+
- s3fs
4244
- scipy
4345
- sqlalchemy
46+
- tabulate
4447
- xarray
4548
- xlrd
4649
- xlsxwriter
4750
- xlwt
51+
- zstandard
4852

4953
# downstream packages
50-
- aiobotocore<2.0.0 # GH#44311 pinned to fix docbuild
54+
- aiobotocore
5155
- boto3
52-
- botocore>=1.11
56+
- botocore
57+
- cftime
5358
- dask
5459
- ipython
5560
- geopandas
@@ -62,5 +67,4 @@ dependencies:
6267
- pandas-datareader
6368
- pyyaml
6469
- py
65-
- pip:
66-
- torch
70+
- pytorch

ci/deps/actions-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies:
3636
- psycopg2
3737
- pymysql
3838
- pytables
39-
- pyarrow=3
39+
- pyarrow
4040
- pyreadstat
4141
- pyxlsb
4242
- s3fs

ci/deps/actions-39.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies:
3636
- psycopg2
3737
- pymysql
3838
- pytables
39-
- pyarrow=5
39+
- pyarrow
4040
- pyreadstat
4141
- pyxlsb
4242
- s3fs

0 commit comments

Comments
 (0)