Skip to content

Commit 9814800

Browse files
committed
Merge branch 'master' into duplicate-cut
2 parents bb70ece + c1aea79 commit 9814800

File tree

171 files changed

+3159
-2095
lines changed

Some content is hidden

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

171 files changed

+3159
-2095
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- 1.3.x
78
pull_request:
89
branches:
910
- master
@@ -23,7 +24,7 @@ jobs:
2324

2425
concurrency:
2526
group: ${{ github.ref }}-checks
26-
cancel-in-progress: true
27+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
2728

2829
steps:
2930
- name: Checkout
@@ -132,15 +133,15 @@ jobs:
132133
echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa
133134
chmod 600 ~/.ssh/id_rsa
134135
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE1Kkopomm7FHG5enATf7SgnpICZ4W2bw+Ho+afqin+w7sMcrsa0je7sbztFAV8YchDkiBKnWTG4cRT+KZgZCaY=" > ~/.ssh/known_hosts
135-
if: github.event_name == 'push'
136+
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
136137

137138
- name: Upload web
138139
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' --exclude='Pandas_Cheat_Sheet*' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
139-
if: github.event_name == 'push'
140+
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
140141

141142
- name: Upload dev docs
142143
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev
143-
if: github.event_name == 'push'
144+
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/master'}}
144145

145146
- name: Move docs into site directory
146147
run: mv doc/build/html web/build/docs

.github/workflows/database.yml

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

3232
concurrency:
3333
group: ${{ github.ref }}-${{ matrix.ENV_FILE }}
34-
cancel-in-progress: true
34+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
3535

3636
services:
3737
mysql:

.github/workflows/posix.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- 1.3.x
78
pull_request:
89
branches:
910
- master
@@ -45,7 +46,7 @@ jobs:
4546
TEST_ARGS: ${{ matrix.settings[6] }}
4647
concurrency:
4748
group: ${{ github.ref }}-${{ matrix.settings[0] }}
48-
cancel-in-progress: true
49+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
4950

5051
steps:
5152
- name: Checkout

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ on:
55
push:
66
branches:
77
- master
8+
- 1.3.x
89

910
jobs:
1011
pre-commit:
1112
runs-on: ubuntu-latest
1213
concurrency:
1314
group: ${{ github.ref }}-pre-commit
14-
cancel-in-progress: true
15+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
1516
steps:
1617
- uses: actions/checkout@v2
1718
- uses: actions/setup-python@v2

.github/workflows/python-dev.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
pull_request:
99
branches:
1010
- master
11+
- 1.3.x
1112
paths-ignore:
1213
- "doc/**"
1314

@@ -25,7 +26,7 @@ jobs:
2526

2627
concurrency:
2728
group: ${{ github.ref }}-dev
28-
cancel-in-progress: true
29+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
2930

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

.github/workflows/sdist.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
- 1.3.x
78
pull_request:
89
branches:
910
- master
@@ -23,6 +24,9 @@ jobs:
2324
fail-fast: false
2425
matrix:
2526
python-version: ["3.8", "3.9"]
27+
concurrency:
28+
group: ${{github.ref}}-${{matrix.python-version}}-sdist
29+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
2630

2731
steps:
2832
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ repos:
5353
types: [text]
5454
args: [--append-config=flake8/cython-template.cfg]
5555
- repo: https://github.com/PyCQA/isort
56-
rev: 5.9.1
56+
rev: 5.9.2
5757
hooks:
5858
- id: isort
5959
- repo: https://github.com/asottile/pyupgrade
60-
rev: v2.20.0
60+
rev: v2.21.0
6161
hooks:
6262
- id: pyupgrade
6363
args: [--py38-plus]

asv_bench/benchmarks/algos/isin.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import numpy as np
22

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
7-
83
from pandas import (
94
Categorical,
105
NaT,
@@ -283,10 +278,6 @@ class IsInLongSeriesLookUpDominates:
283278
def setup(self, dtype, MaxNumber, series_type):
284279
N = 10 ** 7
285280

286-
# https://github.com/pandas-dev/pandas/issues/39844
287-
if not np_version_under1p20 and dtype in ("Int64", "Float64"):
288-
raise NotImplementedError
289-
290281
if series_type == "random_hits":
291282
array = np.random.randint(0, MaxNumber, N)
292283
if series_type == "random_misses":
@@ -297,7 +288,8 @@ def setup(self, dtype, MaxNumber, series_type):
297288
array = np.arange(N) + MaxNumber
298289

299290
self.series = Series(array).astype(dtype)
300-
self.values = np.arange(MaxNumber).astype(dtype)
291+
292+
self.values = np.arange(MaxNumber).astype(dtype.lower())
301293

302294
def time_isin(self, dtypes, MaxNumber, series_type):
303295
self.series.isin(self.values)
@@ -313,16 +305,12 @@ class IsInLongSeriesValuesDominate:
313305
def setup(self, dtype, series_type):
314306
N = 10 ** 7
315307

316-
# https://github.com/pandas-dev/pandas/issues/39844
317-
if not np_version_under1p20 and dtype in ("Int64", "Float64"):
318-
raise NotImplementedError
319-
320308
if series_type == "random":
321309
vals = np.random.randint(0, 10 * N, N)
322310
if series_type == "monotone":
323311
vals = np.arange(N)
324312

325-
self.values = vals.astype(dtype)
313+
self.values = vals.astype(dtype.lower())
326314
M = 10 ** 6 + 1
327315
self.series = Series(np.arange(M)).astype(dtype)
328316

asv_bench/benchmarks/frame_methods.py

Lines changed: 16 additions & 0 deletions
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/io/csv.py

Lines changed: 3 additions & 2 deletions
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):

0 commit comments

Comments
 (0)