Skip to content

Commit 1f4a08a

Browse files
authored
Merge branch 'master' into take-error
2 parents 3f85056 + 0b0cac5 commit 1f4a08a

File tree

346 files changed

+5977
-3512
lines changed

Some content is hidden

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

346 files changed

+5977
-3512
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
shell: bash -l {0}
2424

2525
concurrency:
26-
group: ${{ github.ref }}-checks
27-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
26+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
27+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-checks
28+
cancel-in-progress: true
2829

2930
steps:
3031
- name: Checkout
@@ -102,7 +103,8 @@ jobs:
102103
runs-on: ubuntu-latest
103104

104105
concurrency:
105-
group: ${{ github.ref }}-web-docs
106+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
107+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-web-docs
106108
cancel-in-progress: true
107109

108110
steps:
@@ -160,11 +162,20 @@ jobs:
160162
data_manager:
161163
name: Test experimental data manager
162164
runs-on: ubuntu-latest
165+
services:
166+
moto:
167+
image: motoserver/moto
168+
env:
169+
AWS_ACCESS_KEY_ID: foobar_key
170+
AWS_SECRET_ACCESS_KEY: foobar_secret
171+
ports:
172+
- 5000:5000
163173
strategy:
164174
matrix:
165175
pattern: ["not slow and not network and not clipboard", "slow"]
166176
concurrency:
167-
group: ${{ github.ref }}-data_manager-${{ matrix.pattern }}
177+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
178+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-data_manager-${{ matrix.pattern }}
168179
cancel-in-progress: true
169180

170181
steps:

.github/workflows/database.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ jobs:
3131
fail-fast: false
3232

3333
concurrency:
34-
group: ${{ github.ref }}-${{ matrix.ENV_FILE }}
35-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
34+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
35+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.ENV_FILE }}
36+
cancel-in-progress: true
3637

3738
services:
3839
mysql:
@@ -62,6 +63,14 @@ jobs:
6263
ports:
6364
- 5432:5432
6465

66+
moto:
67+
image: motoserver/moto
68+
env:
69+
AWS_ACCESS_KEY_ID: foobar_key
70+
AWS_SECRET_ACCESS_KEY: foobar_secret
71+
ports:
72+
- 5000:5000
73+
6574
steps:
6675
- name: Checkout
6776
uses: actions/checkout@v2

.github/workflows/posix.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
settings: [
2828
[actions-38-minimum_versions.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
2929
[actions-38-locale_slow.yaml, "slow", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""],
30-
[actions-38.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
30+
[actions-38.yaml, "not slow and not clipboard", "", "", "", "", ""],
3131
[actions-38-slow.yaml, "slow", "", "", "", "", ""],
3232
[actions-38-locale.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""],
3333
[actions-39-slow.yaml, "slow", "", "", "", "", ""],
3434
[actions-39-numpydev.yaml, "not slow and not network", "xsel", "", "", "deprecate", "-W error"],
35-
[actions-39.yaml, "not slow and not network and not clipboard", "", "", "", "", ""]
35+
[actions-39.yaml, "not slow and not clipboard", "", "", "", "", ""]
3636
]
3737
fail-fast: false
3838
env:
@@ -46,8 +46,17 @@ jobs:
4646
TEST_ARGS: ${{ matrix.settings[6] }}
4747
PYTEST_TARGET: pandas
4848
concurrency:
49-
group: ${{ github.ref }}-${{ matrix.settings[0] }}
50-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
49+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
50+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}
51+
cancel-in-progress: true
52+
services:
53+
moto:
54+
image: motoserver/moto
55+
env:
56+
AWS_ACCESS_KEY_ID: foobar_key
57+
AWS_SECRET_ACCESS_KEY: foobar_secret
58+
ports:
59+
- 5000:5000
5160

5261
steps:
5362
- name: Checkout

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ jobs:
1111
pre-commit:
1212
runs-on: ubuntu-latest
1313
concurrency:
14-
group: ${{ github.ref }}-pre-commit
15-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
14+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
15+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pre-commit
16+
cancel-in-progress: true
1617
steps:
1718
- uses: actions/checkout@v2
1819
- uses: actions/setup-python@v2

.github/workflows/python-dev.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ jobs:
3131
timeout-minutes: 80
3232

3333
concurrency:
34-
group: ${{ github.ref }}-${{ matrix.os }}-${{ matrix.pytest_target }}-dev
35-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
34+
#https://github.community/t/concurrecy-not-work-for-push/183068/7
35+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-${{ matrix.pytest_target }}-dev
36+
cancel-in-progress: true
3637

3738
steps:
3839
- uses: actions/checkout@v2

.github/workflows/sdist.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ jobs:
2525
matrix:
2626
python-version: ["3.8", "3.9", "3.10"]
2727
concurrency:
28-
group: ${{github.ref}}-${{matrix.python-version}}-sdist
29-
cancel-in-progress: ${{github.event_name == 'pull_request'}}
28+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
29+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{matrix.python-version}}-sdist
30+
cancel-in-progress: true
3031

3132
steps:
3233
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
- id: absolufy-imports
1010
files: ^pandas/
1111
- repo: https://github.com/python/black
12-
rev: 21.10b0
12+
rev: 21.11b1
1313
hooks:
1414
- id: black
1515
- repo: https://github.com/codespell-project/codespell
@@ -55,11 +55,11 @@ repos:
5555
types: [text]
5656
args: [--append-config=flake8/cython-template.cfg]
5757
- repo: https://github.com/PyCQA/isort
58-
rev: 5.9.3
58+
rev: 5.10.1
5959
hooks:
6060
- id: isort
6161
- repo: https://github.com/asottile/pyupgrade
62-
rev: v2.29.0
62+
rev: v2.29.1
6363
hooks:
6464
- id: pyupgrade
6565
args: [--py38-plus]
@@ -111,6 +111,8 @@ repos:
111111
# Incorrect code-block / IPython directives
112112
|\.\.\ code-block\ ::
113113
|\.\.\ ipython\ ::
114+
# directive should not have a space before ::
115+
|\.\.\ \w+\ ::
114116
115117
# Check for deprecated messages without sphinx directive
116118
|(DEPRECATED|DEPRECATE|Deprecated)(:|,|\.)

asv_bench/benchmarks/frame_ctor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
)
2020
except ImportError:
2121
# For compatibility with older versions
22-
from pandas.core.datetools import * # noqa
22+
from pandas.core.datetools import (
23+
Hour,
24+
Nano,
25+
)
2326

2427

2528
class FromDicts:

asv_bench/benchmarks/frame_methods.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def time_reindex_axis1_missing(self):
7676
self.df.reindex(columns=self.idx)
7777

7878
def time_reindex_both_axes(self):
79-
self.df.reindex(index=self.idx, columns=self.idx)
79+
self.df.reindex(index=self.idx, columns=self.idx_cols)
8080

8181
def time_reindex_upcast(self):
8282
self.df2.reindex(np.random.permutation(range(1200)))
@@ -731,17 +731,6 @@ def time_dataframe_describe(self):
731731
self.df.describe()
732732

733733

734-
class SelectDtypes:
735-
params = [100, 1000]
736-
param_names = ["n"]
737-
738-
def setup(self, n):
739-
self.df = DataFrame(np.random.randn(10, n))
740-
741-
def time_select_dtypes(self, n):
742-
self.df.select_dtypes(include="int")
743-
744-
745734
class MemoryUsage:
746735
def setup(self):
747736
self.df = DataFrame(np.random.randn(100000, 2), columns=list("AB"))

asv_bench/benchmarks/groupby.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ class GroupByMethods:
443443
"var",
444444
],
445445
["direct", "transformation"],
446-
[1, 2, 5, 10],
446+
[1, 5],
447447
]
448448

449449
def setup(self, dtype, method, application, ncols):
@@ -455,6 +455,7 @@ def setup(self, dtype, method, application, ncols):
455455
raise NotImplementedError
456456

457457
if application == "transformation" and method in [
458+
"describe",
458459
"head",
459460
"tail",
460461
"unique",
@@ -464,7 +465,12 @@ def setup(self, dtype, method, application, ncols):
464465
# DataFrameGroupBy doesn't have these methods
465466
raise NotImplementedError
466467

467-
ngroups = 1000
468+
if method == "describe":
469+
ngroups = 20
470+
elif method in ["mad", "skew"]:
471+
ngroups = 100
472+
else:
473+
ngroups = 1000
468474
size = ngroups * 2
469475
rng = np.arange(ngroups).reshape(-1, 1)
470476
rng = np.broadcast_to(rng, (len(rng), ncols))
@@ -491,9 +497,6 @@ def setup(self, dtype, method, application, ncols):
491497
cols = cols[0]
492498

493499
if application == "transformation":
494-
if method == "describe":
495-
raise NotImplementedError
496-
497500
self.as_group_method = lambda: df.groupby("key")[cols].transform(method)
498501
self.as_field_method = lambda: df.groupby(cols)["key"].transform(method)
499502
else:

asv_bench/benchmarks/io/csv.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,4 +525,14 @@ def time_to_datetime_format_DD_MM_YYYY(self, cache_dates):
525525
to_datetime(df["date"], cache=cache_dates, format="%d-%m-%Y")
526526

527527

528+
class ReadCSVIndexCol(StringIORewind):
529+
def setup(self):
530+
count_elem = 100_000
531+
data = "a,b\n" + "1,2\n" * count_elem
532+
self.StringIO_input = StringIO(data)
533+
534+
def time_read_csv_index_col(self):
535+
read_csv(self.StringIO_input, index_col="a")
536+
537+
528538
from ..pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/pandas_vb_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
try:
1818
import pandas._testing as tm
1919
except ImportError:
20-
import pandas.util.testing as tm # noqa
20+
import pandas.util.testing as tm # noqa:F401
2121

2222

2323
numeric_dtypes = [

asv_bench/benchmarks/rolling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class NumbaEngineMethods:
5353
["DataFrame", "Series"],
5454
["int", "float"],
5555
[("rolling", {"window": 10}), ("expanding", {})],
56-
["sum", "max", "min", "median", "mean"],
56+
["sum", "max", "min", "median", "mean", "var", "std"],
5757
[True, False],
5858
[None, 100],
5959
)

ci/azure/posix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
py38_macos_1:
1313
ENV_FILE: ci/deps/azure-macos-38.yaml
1414
CONDA_PY: "38"
15-
PATTERN: "not slow and not network"
15+
PATTERN: "not slow"
1616
PYTEST_TARGET: "pandas/tests/[a-h]*"
1717
py38_macos_2:
1818
ENV_FILE: ci/deps/azure-macos-38.yaml
1919
CONDA_PY: "38"
20-
PATTERN: "not slow and not network"
20+
PATTERN: "not slow"
2121
PYTEST_TARGET: "pandas/tests/[i-z]*"
2222

2323
steps:

ci/azure/windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ jobs:
1111
py38_np18_1:
1212
ENV_FILE: ci/deps/azure-windows-38.yaml
1313
CONDA_PY: "38"
14-
PATTERN: "not slow and not network"
14+
PATTERN: "not slow"
1515
PYTEST_WORKERS: 2 # GH-42236
1616
PYTEST_TARGET: "pandas/tests/[a-h]*"
1717

1818
py38_np18_2:
1919
ENV_FILE: ci/deps/azure-windows-38.yaml
2020
CONDA_PY: "38"
21-
PATTERN: "not slow and not network"
21+
PATTERN: "not slow"
2222
PYTEST_WORKERS: 2 # GH-42236
2323
PYTEST_TARGET: "pandas/tests/[i-z]*"
2424

2525
py39_1:
2626
ENV_FILE: ci/deps/azure-windows-39.yaml
2727
CONDA_PY: "39"
28-
PATTERN: "not slow and not network and not high_memory"
28+
PATTERN: "not slow and not high_memory"
2929
PYTEST_WORKERS: 2 # GH-42236
3030
PYTEST_TARGET: "pandas/tests/[a-h]*"
3131

3232
py39_2:
3333
ENV_FILE: ci/deps/azure-windows-39.yaml
3434
CONDA_PY: "39"
35-
PATTERN: "not slow and not network and not high_memory"
35+
PATTERN: "not slow and not high_memory"
3636
PYTEST_WORKERS: 2 # GH-42236
3737
PYTEST_TARGET: "pandas/tests/[i-z]*"
3838

ci/code_checks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ fi
9393
### DOCSTRINGS ###
9494
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9595

96-
MSG='Validate docstrings (GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS03, SS04, SS05, PR03, PR04, PR05, PRO9, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG
97-
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS03,SS04,SS05,PR03,PR04,PR05,PR09,PR10,EX04,RT01,RT04,RT05,SA02,SA03
96+
MSG='Validate docstrings (GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS03, SS04, SS05, PR03, PR04, PR05, PR06, PR08, PR09, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG
97+
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS03,SS04,SS05,PR03,PR04,PR05,PR06,PR08,PR09,PR10,EX04,RT01,RT04,RT05,SA02,SA03
9898
RET=$(($RET + $?)) ; echo $MSG "DONE"
9999

100100
fi

ci/deps/actions-38-db-min.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ dependencies:
3838
- xlrd
3939
- xlsxwriter
4040
- xlwt
41-
- moto
42-
- flask
4341

4442
# sql
4543
- psycopg2=2.8.4
4644
- pymysql=0.10.1
47-
- sqlalchemy=1.3.11
45+
- sqlalchemy=1.4.0

ci/deps/actions-38-db.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies:
1414
# pandas dependencies
1515
- aiobotocore<2.0.0
1616
- beautifulsoup4
17+
- boto3
1718
- botocore>=1.11
1819
- dask
1920
- fastparquet>=0.4.0
@@ -22,8 +23,6 @@ dependencies:
2223
- geopandas
2324
- html5lib
2425
- matplotlib
25-
- moto>=1.3.14
26-
- flask
2726
- nomkl
2827
- numexpr
2928
- numpy=1.18

ci/deps/actions-38-locale.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ dependencies:
1414

1515
# pandas dependencies
1616
- beautifulsoup4
17-
- flask
1817
- html5lib
1918
- ipython
2019
- jinja2
2120
- jedi
2221
- lxml
2322
- matplotlib<3.3.0
24-
- moto
2523
- nomkl
2624
- numexpr
2725
- numpy<1.20 # GH#39541 compat with pyarrow<3
@@ -34,7 +32,6 @@ dependencies:
3432
- xlrd
3533
- xlsxwriter
3634
- xlwt
37-
- moto
3835
- pyarrow=1.0.1
3936
- pip
4037
- pip:

0 commit comments

Comments
 (0)