Skip to content

Commit 180f329

Browse files
Merge remote-tracking branch 'upstream/main' into bisect
2 parents a078c89 + a0779ad commit 180f329

File tree

438 files changed

+11526
-6491
lines changed

Some content is hidden

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

438 files changed

+11526
-6491
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

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44
autofix_prs: false
55
repos:
66
- repo: https://github.com/MarcoGorelli/absolufy-imports
7-
rev: v0.3.0
7+
rev: v0.3.1
88
hooks:
99
- id: absolufy-imports
1010
files: ^pandas/
@@ -16,7 +16,7 @@ repos:
1616
pass_filenames: true
1717
require_serial: false
1818
- repo: https://github.com/python/black
19-
rev: 21.12b0
19+
rev: 22.1.0
2020
hooks:
2121
- id: black
2222
- repo: https://github.com/codespell-project/codespell
@@ -50,7 +50,7 @@ repos:
5050
- flake8==4.0.1
5151
- flake8-comprehensions==3.7.0
5252
- flake8-bugbear==21.3.2
53-
- pandas-dev-flaker==0.2.0
53+
- pandas-dev-flaker==0.4.0
5454
- repo: https://github.com/PyCQA/isort
5555
rev: 5.10.1
5656
hooks:
@@ -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/algorithms.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Factorize:
3434
param_names = ["unique", "sort", "dtype"]
3535

3636
def setup(self, unique, sort, dtype):
37-
N = 10 ** 5
37+
N = 10**5
3838
string_index = tm.makeStringIndex(N)
3939
string_arrow = None
4040
if dtype == "string[pyarrow]":
@@ -74,7 +74,7 @@ class Duplicated:
7474
param_names = ["unique", "keep", "dtype"]
7575

7676
def setup(self, unique, keep, dtype):
77-
N = 10 ** 5
77+
N = 10**5
7878
data = {
7979
"int": pd.Index(np.arange(N), dtype="int64"),
8080
"uint": pd.Index(np.arange(N), dtype="uint64"),
@@ -97,7 +97,7 @@ def time_duplicated(self, unique, keep, dtype):
9797

9898
class Hashing:
9999
def setup_cache(self):
100-
N = 10 ** 5
100+
N = 10**5
101101

102102
df = pd.DataFrame(
103103
{
@@ -145,7 +145,7 @@ class Quantile:
145145
param_names = ["quantile", "interpolation", "dtype"]
146146

147147
def setup(self, quantile, interpolation, dtype):
148-
N = 10 ** 5
148+
N = 10**5
149149
data = {
150150
"int": np.arange(N),
151151
"uint": np.arange(N).astype(np.uint64),
@@ -158,7 +158,7 @@ def time_quantile(self, quantile, interpolation, dtype):
158158

159159

160160
class SortIntegerArray:
161-
params = [10 ** 3, 10 ** 5]
161+
params = [10**3, 10**5]
162162

163163
def setup(self, N):
164164
data = np.arange(N, dtype=float)

asv_bench/benchmarks/algos/isin.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def setup(self, dtype):
4949

5050
elif dtype in ["category[object]", "category[int]"]:
5151
# Note: sizes are different in this case than others
52-
n = 5 * 10 ** 5
52+
n = 5 * 10**5
5353
sample_size = 100
5454

5555
arr = list(np.random.randint(0, n // 10, size=n))
@@ -174,7 +174,7 @@ class IsinWithArange:
174174

175175
def setup(self, dtype, M, offset_factor):
176176
offset = int(M * offset_factor)
177-
tmp = Series(np.random.randint(offset, M + offset, 10 ** 6))
177+
tmp = Series(np.random.randint(offset, M + offset, 10**6))
178178
self.series = tmp.astype(dtype)
179179
self.values = np.arange(M).astype(dtype)
180180

@@ -191,8 +191,8 @@ class IsInFloat64:
191191
param_names = ["dtype", "title"]
192192

193193
def setup(self, dtype, title):
194-
N_many = 10 ** 5
195-
N_few = 10 ** 6
194+
N_many = 10**5
195+
N_few = 10**6
196196
self.series = Series([1, 2], dtype=dtype)
197197

198198
if title == "many_different_values":
@@ -240,10 +240,10 @@ class IsInForObjects:
240240
param_names = ["series_type", "vals_type"]
241241

242242
def setup(self, series_type, vals_type):
243-
N_many = 10 ** 5
243+
N_many = 10**5
244244

245245
if series_type == "nans":
246-
ser_vals = np.full(10 ** 4, np.nan)
246+
ser_vals = np.full(10**4, np.nan)
247247
elif series_type == "short":
248248
ser_vals = np.arange(2)
249249
elif series_type == "long":
@@ -254,7 +254,7 @@ def setup(self, series_type, vals_type):
254254
self.series = Series(ser_vals).astype(object)
255255

256256
if vals_type == "nans":
257-
values = np.full(10 ** 4, np.nan)
257+
values = np.full(10**4, np.nan)
258258
elif vals_type == "short":
259259
values = np.arange(2)
260260
elif vals_type == "long":
@@ -277,7 +277,7 @@ class IsInLongSeriesLookUpDominates:
277277
param_names = ["dtype", "MaxNumber", "series_type"]
278278

279279
def setup(self, dtype, MaxNumber, series_type):
280-
N = 10 ** 7
280+
N = 10**7
281281

282282
if series_type == "random_hits":
283283
array = np.random.randint(0, MaxNumber, N)
@@ -304,15 +304,15 @@ class IsInLongSeriesValuesDominate:
304304
param_names = ["dtype", "series_type"]
305305

306306
def setup(self, dtype, series_type):
307-
N = 10 ** 7
307+
N = 10**7
308308

309309
if series_type == "random":
310310
vals = np.random.randint(0, 10 * N, N)
311311
if series_type == "monotone":
312312
vals = np.arange(N)
313313

314314
self.values = vals.astype(dtype.lower())
315-
M = 10 ** 6 + 1
315+
M = 10**6 + 1
316316
self.series = Series(np.arange(M)).astype(dtype)
317317

318318
def time_isin(self, dtypes, series_type):

asv_bench/benchmarks/arithmetic.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def time_frame_op_with_scalar(self, dtype, scalar, op):
5959
class OpWithFillValue:
6060
def setup(self):
6161
# GH#31300
62-
arr = np.arange(10 ** 6)
62+
arr = np.arange(10**6)
6363
df = DataFrame({"A": arr})
6464
ser = df["A"]
6565

@@ -93,7 +93,7 @@ class MixedFrameWithSeriesAxis:
9393
param_names = ["opname"]
9494

9595
def setup(self, opname):
96-
arr = np.arange(10 ** 6).reshape(1000, -1)
96+
arr = np.arange(10**6).reshape(1000, -1)
9797
df = DataFrame(arr)
9898
df["C"] = 1.0
9999
self.df = df
@@ -201,7 +201,7 @@ def teardown(self, use_numexpr, threads):
201201

202202
class Ops2:
203203
def setup(self):
204-
N = 10 ** 3
204+
N = 10**3
205205
self.df = DataFrame(np.random.randn(N, N))
206206
self.df2 = DataFrame(np.random.randn(N, N))
207207

@@ -258,7 +258,7 @@ class Timeseries:
258258
param_names = ["tz"]
259259

260260
def setup(self, tz):
261-
N = 10 ** 6
261+
N = 10**6
262262
halfway = (N // 2) - 1
263263
self.s = Series(date_range("20010101", periods=N, freq="T", tz=tz))
264264
self.ts = self.s[halfway]
@@ -280,7 +280,7 @@ def time_timestamp_ops_diff_with_shift(self, tz):
280280

281281
class IrregularOps:
282282
def setup(self):
283-
N = 10 ** 5
283+
N = 10**5
284284
idx = date_range(start="1/1/2000", periods=N, freq="s")
285285
s = Series(np.random.randn(N), index=idx)
286286
self.left = s.sample(frac=1)
@@ -304,7 +304,7 @@ class CategoricalComparisons:
304304
param_names = ["op"]
305305

306306
def setup(self, op):
307-
N = 10 ** 5
307+
N = 10**5
308308
self.cat = pd.Categorical(list("aabbcd") * N, ordered=True)
309309

310310
def time_categorical_op(self, op):
@@ -317,7 +317,7 @@ class IndexArithmetic:
317317
param_names = ["dtype"]
318318

319319
def setup(self, dtype):
320-
N = 10 ** 6
320+
N = 10**6
321321
indexes = {"int": "makeIntIndex", "float": "makeFloatIndex"}
322322
self.index = getattr(tm, indexes[dtype])(N)
323323

@@ -343,7 +343,7 @@ class NumericInferOps:
343343
param_names = ["dtype"]
344344

345345
def setup(self, dtype):
346-
N = 5 * 10 ** 5
346+
N = 5 * 10**5
347347
self.df = DataFrame(
348348
{"A": np.arange(N).astype(dtype), "B": np.arange(N).astype(dtype)}
349349
)
@@ -367,7 +367,7 @@ def time_modulo(self, dtype):
367367
class DateInferOps:
368368
# from GH 7332
369369
def setup_cache(self):
370-
N = 5 * 10 ** 5
370+
N = 5 * 10**5
371371
df = DataFrame({"datetime64": np.arange(N).astype("datetime64[ms]")})
372372
df["timedelta"] = df["datetime64"] - df["datetime64"]
373373
return df
@@ -388,7 +388,7 @@ class AddOverflowScalar:
388388
param_names = ["scalar"]
389389

390390
def setup(self, scalar):
391-
N = 10 ** 6
391+
N = 10**6
392392
self.arr = np.arange(N)
393393

394394
def time_add_overflow_scalar(self, scalar):
@@ -397,7 +397,7 @@ def time_add_overflow_scalar(self, scalar):
397397

398398
class AddOverflowArray:
399399
def setup(self):
400-
N = 10 ** 6
400+
N = 10**6
401401
self.arr = np.arange(N)
402402
self.arr_rev = np.arange(-N, 0)
403403
self.arr_mixed = np.array([1, -1]).repeat(N / 2)

0 commit comments

Comments
 (0)