Skip to content

Commit 3c3eca4

Browse files
authored
Merge branch 'pandas-dev:master' into write-to
2 parents c5ff4b1 + d60e687 commit 3c3eca4

File tree

255 files changed

+5523
-3338
lines changed

Some content is hidden

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

255 files changed

+5523
-3338
lines changed

.github/workflows/ci.yml

+1-2
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:
@@ -24,7 +23,7 @@ jobs:
2423

2524
concurrency:
2625
group: ${{ github.ref }}-checks
27-
cancel-in-progress: true
26+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
2827

2928
steps:
3029
- name: Checkout

.github/workflows/database.yml

+3-4
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/**"
@@ -19,20 +18,20 @@ env:
1918
COVERAGE: true
2019

2120
jobs:
22-
Linux_py37_IO:
21+
Linux_py38_IO:
2322
runs-on: ubuntu-latest
2423
defaults:
2524
run:
2625
shell: bash -l {0}
2726

2827
strategy:
2928
matrix:
30-
ENV_FILE: [ci/deps/actions-37-db-min.yaml, ci/deps/actions-37-db.yaml]
29+
ENV_FILE: [ci/deps/actions-38-db-min.yaml, ci/deps/actions-38-db.yaml]
3130
fail-fast: false
3231

3332
concurrency:
3433
group: ${{ github.ref }}-${{ matrix.ENV_FILE }}
35-
cancel-in-progress: true
34+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
3635

3736
services:
3837
mysql:

.github/workflows/posix.yml

+5-7
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/**"
@@ -25,14 +24,13 @@ jobs:
2524
strategy:
2625
matrix:
2726
settings: [
28-
[actions-37-minimum_versions.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
29-
[actions-37.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
30-
[actions-37-locale_slow.yaml, "slow", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""],
31-
[actions-37-slow.yaml, "slow", "", "", "", "", ""],
27+
[actions-38-minimum_versions.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
28+
[actions-38-locale_slow.yaml, "slow", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""],
3229
[actions-38.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
3330
[actions-38-slow.yaml, "slow", "", "", "", "", ""],
3431
[actions-38-locale.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""],
35-
[actions-38-numpydev.yaml, "not slow and not network", "xsel", "", "", "deprecate", "-W error"],
32+
[actions-39-slow.yaml, "slow", "", "", "", "", ""],
33+
[actions-39-numpydev.yaml, "not slow and not network", "xsel", "", "", "deprecate", "-W error"],
3634
[actions-39.yaml, "not slow and not network and not clipboard", "", "", "", "", ""]
3735
]
3836
fail-fast: false
@@ -47,7 +45,7 @@ jobs:
4745
TEST_ARGS: ${{ matrix.settings[6] }}
4846
concurrency:
4947
group: ${{ github.ref }}-${{ matrix.settings[0] }}
50-
cancel-in-progress: true
48+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
5149

5250
steps:
5351
- name: Checkout

.github/workflows/pre-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
concurrency:
1313
group: ${{ github.ref }}-pre-commit
14-
cancel-in-progress: true
14+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
1515
steps:
1616
- uses: actions/checkout@v2
1717
- uses: actions/setup-python@v2

.github/workflows/python-dev.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ on:
44
push:
55
branches:
66
- master
7+
- 1.3.x
78
pull_request:
89
branches:
910
- master
1011
paths-ignore:
1112
- "doc/**"
1213

14+
env:
15+
PYTEST_WORKERS: "auto"
16+
PANDAS_CI: 1
17+
PATTERN: "not slow and not network and not clipboard"
18+
COVERAGE: true
19+
1320
jobs:
1421
build:
1522
runs-on: ubuntu-latest
@@ -18,7 +25,7 @@ jobs:
1825

1926
concurrency:
2027
group: ${{ github.ref }}-dev
21-
cancel-in-progress: true
28+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
2229

2330
steps:
2431
- uses: actions/checkout@v2
@@ -36,7 +43,7 @@ jobs:
3643
pip install git+https://github.com/numpy/numpy.git
3744
pip install git+https://github.com/pytest-dev/pytest.git
3845
pip install git+https://github.com/nedbat/coveragepy.git
39-
pip install cython python-dateutil pytz hypothesis pytest-xdist
46+
pip install cython python-dateutil pytz hypothesis pytest-xdist pytest-cov
4047
pip list
4148
4249
- name: Build Pandas
@@ -50,7 +57,8 @@ jobs:
5057
5158
- name: Test with pytest
5259
run: |
53-
coverage run -m pytest -m 'not slow and not network and not clipboard' pandas
60+
ci/run_tests.sh
61+
# GH 41935
5462
continue-on-error: true
5563

5664
- name: Publish test results

.github/workflows/sdist.yml

+4-2
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/**"
@@ -23,7 +22,10 @@ jobs:
2322
strategy:
2423
fail-fast: false
2524
matrix:
26-
python-version: ["3.7", "3.8", "3.9"]
25+
python-version: ["3.8", "3.9"]
26+
concurrency:
27+
group: ${{github.ref}}-${{matrix.python-version}}-sdist
28+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
2729

2830
steps:
2931
- uses: actions/checkout@v2

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ repos:
5353
types: [text]
5454
args: [--append-config=flake8/cython-template.cfg]
5555
- repo: https://github.com/PyCQA/isort
56-
rev: 5.9.0
56+
rev: 5.9.2
5757
hooks:
5858
- id: isort
5959
- repo: https://github.com/asottile/pyupgrade
60-
rev: v2.19.4
60+
rev: v2.21.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/algos/isin.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import numpy as np
22

3-
from pandas.compat.numpy import np_version_under1p20
3+
try:
4+
from pandas.compat import np_version_under1p20
5+
except ImportError:
6+
from pandas.compat.numpy import _np_version_under1p20 as np_version_under1p20
47

58
from pandas import (
69
Categorical,

asv_bench/benchmarks/frame_methods.py

+16
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,22 @@ def time_to_html_mixed(self):
232232
self.df2.to_html()
233233

234234

235+
class ToDict:
236+
params = [["dict", "list", "series", "split", "records", "index"]]
237+
param_names = ["orient"]
238+
239+
def setup(self, orient):
240+
data = np.random.randint(0, 1000, size=(10000, 4))
241+
self.int_df = DataFrame(data)
242+
self.datetimelike_df = self.int_df.astype("timedelta64[ns]")
243+
244+
def time_to_dict_ints(self, orient):
245+
self.int_df.to_dict(orient=orient)
246+
247+
def time_to_dict_datetimelike(self, orient):
248+
self.datetimelike_df.to_dict(orient=orient)
249+
250+
235251
class ToNumpy:
236252
def setup(self):
237253
N = 10000

asv_bench/benchmarks/groupby.py

+14
Original file line numberDiff line numberDiff line change
@@ -832,4 +832,18 @@ def function(values):
832832
self.grouper.agg(function, engine="cython")
833833

834834

835+
class Sample:
836+
def setup(self):
837+
N = 10 ** 3
838+
self.df = DataFrame({"a": np.zeros(N)})
839+
self.groups = np.arange(0, N)
840+
self.weights = np.ones(N)
841+
842+
def time_sample(self):
843+
self.df.groupby(self.groups).sample(n=1)
844+
845+
def time_sample_weights(self):
846+
self.df.groupby(self.groups).sample(n=1, weights=self.weights)
847+
848+
835849
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/io/csv.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ class ReadCSVFloatPrecision(StringIORewind):
291291

292292
def setup(self, sep, decimal, float_precision):
293293
floats = [
294-
"".join(random.choice(string.digits) for _ in range(28)) for _ in range(15)
294+
"".join([random.choice(string.digits) for _ in range(28)])
295+
for _ in range(15)
295296
]
296297
rows = sep.join([f"0{decimal}" + "{}"] * 3) + "\n"
297298
data = rows * 5
@@ -395,7 +396,7 @@ class ReadCSVCachedParseDates(StringIORewind):
395396
param_names = ["do_cache", "engine"]
396397

397398
def setup(self, do_cache, engine):
398-
data = ("\n".join(f"10/{year}" for year in range(2000, 2100)) + "\n") * 10
399+
data = ("\n".join([f"10/{year}" for year in range(2000, 2100)]) + "\n") * 10
399400
self.StringIO_input = StringIO(data)
400401

401402
def time_read_csv_cached(self, do_cache, engine):

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

+5-6
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:
@@ -22,14 +21,14 @@ jobs:
2221
- template: ci/azure/posix.yml
2322
parameters:
2423
name: macOS
25-
vmImage: macOS-10.14
24+
vmImage: macOS-10.15
2625

2726
- template: ci/azure/windows.yml
2827
parameters:
2928
name: Windows
30-
vmImage: vs2017-win2016
29+
vmImage: windows-2019
3130

32-
- job: py37_32bit
31+
- job: py38_32bit
3332
pool:
3433
vmImage: ubuntu-18.04
3534

@@ -38,7 +37,7 @@ jobs:
3837
docker pull quay.io/pypa/manylinux2014_i686
3938
docker run -v $(pwd):/pandas quay.io/pypa/manylinux2014_i686 \
4039
/bin/bash -xc "cd pandas && \
41-
/opt/python/cp37-cp37m/bin/python -m venv ~/virtualenvs/pandas-dev && \
40+
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \
4241
. ~/virtualenvs/pandas-dev/bin/activate && \
4342
python -m pip install --no-deps -U pip wheel setuptools && \
4443
pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines && \
@@ -52,4 +51,4 @@ jobs:
5251
inputs:
5352
testResultsFiles: '**/test-*.xml'
5453
failTaskOnFailedTests: true
55-
testRunTitle: 'Publish test results for Python 3.7-32 bit full Linux'
54+
testRunTitle: 'Publish test results for Python 3.8-32 bit full Linux'

ci/azure/posix.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jobs:
99
strategy:
1010
matrix:
1111
${{ if eq(parameters.name, 'macOS') }}:
12-
py37_macos:
13-
ENV_FILE: ci/deps/azure-macos-37.yaml
14-
CONDA_PY: "37"
12+
py38_macos:
13+
ENV_FILE: ci/deps/azure-macos-38.yaml
14+
CONDA_PY: "38"
1515
PATTERN: "not slow and not network"
1616

1717
steps:

ci/azure/windows.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,39 @@ jobs:
88
vmImage: ${{ parameters.vmImage }}
99
strategy:
1010
matrix:
11-
py37_np17:
12-
ENV_FILE: ci/deps/azure-windows-37.yaml
13-
CONDA_PY: "37"
14-
PATTERN: "not slow and not network"
15-
1611
py38_np18:
1712
ENV_FILE: ci/deps/azure-windows-38.yaml
1813
CONDA_PY: "38"
14+
PATTERN: "not slow and not network"
15+
PYTEST_WORKERS: 2 # GH-42236
16+
17+
py39:
18+
ENV_FILE: ci/deps/azure-windows-39.yaml
19+
CONDA_PY: "39"
1920
PATTERN: "not slow and not network and not high_memory"
21+
PYTEST_WORKERS: 2 # GH-42236
2022

2123
steps:
2224
- powershell: |
2325
Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
2426
Write-Host "##vso[task.prependpath]$HOME/miniconda3/bin"
2527
displayName: 'Add conda to PATH'
26-
2728
- script: conda update -q -n base conda
2829
displayName: 'Update conda'
2930

3031
- bash: |
3132
conda env create -q --file ci\\deps\\azure-windows-$(CONDA_PY).yaml
3233
displayName: 'Create anaconda environment'
33-
3434
- bash: |
3535
source activate pandas-dev
3636
conda list
3737
python setup.py build_ext -q -j 4
3838
python -m pip install --no-build-isolation -e .
3939
displayName: 'Build'
40-
4140
- bash: |
4241
source activate pandas-dev
4342
ci/run_tests.sh
4443
displayName: 'Test'
45-
4644
- task: PublishTestResults@2
4745
condition: succeededOrFailed()
4846
inputs:

ci/deps/actions-37-locale_slow.yaml

-30
This file was deleted.

0 commit comments

Comments
 (0)