Skip to content

Commit 8080e79

Browse files
authored
Merge branch 'main' into gha-win-mac
2 parents d9c88ff + d5ba8c0 commit 8080e79

File tree

152 files changed

+1626
-1234
lines changed

Some content is hidden

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

152 files changed

+1626
-1234
lines changed

.github/workflows/32-bit-linux.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: 32 Bit Linux
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 1.4.x
8+
pull_request:
9+
branches:
10+
- main
11+
- 1.4.x
12+
paths-ignore:
13+
- "doc/**"
14+
15+
jobs:
16+
pytest:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Run 32-bit manylinux2014 Docker Build / Tests
25+
run: |
26+
docker pull quay.io/pypa/manylinux2014_i686
27+
docker run --platform linux/386 -v $(pwd):/pandas quay.io/pypa/manylinux2014_i686 \
28+
/bin/bash -xc "cd pandas && \
29+
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \
30+
. ~/virtualenvs/pandas-dev/bin/activate && \
31+
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
32+
pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
33+
python setup.py build_ext -q -j2 && \
34+
python -m pip install --no-build-isolation --no-use-pep517 -e . && \
35+
export PANDAS_CI=1 && \
36+
pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml"
37+
38+
- name: Publish test results for Python 3.8-32 bit full Linux
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: Test results
42+
path: test-data.xml
43+
if: failure()

.github/workflows/code-checks.yml

Lines changed: 1 addition & 1 deletion
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 pyright@1.1.245
77+
run: npm install -g pyright@1.1.247
7878

7979
- name: Build Pandas
8080
id: build

.github/workflows/macos-windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: macOS and Windows
1+
name: Windows-MacOS
22

33
on:
44
push:
@@ -18,23 +18,23 @@ env:
1818
PYTEST_WORKERS: auto
1919
PATTERN: "not slow and not db and not network and not single_cpu"
2020

21+
2122
jobs:
2223
pytest:
23-
runs-on: ${{ matrix.os }}
2424
defaults:
2525
run:
2626
shell: bash -el {0}
2727
timeout-minutes: 90
2828
strategy:
2929
matrix:
30-
os: [windows-latest, ubuntu-latest]
30+
os: [macos-latest, windows-latest]
3131
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml]
32-
pyarrow_version: [6]
3332
fail-fast: false
33+
runs-on: ${{ matrix.os }}
3434
name: ${{ matrix.name || format('{0} {1} pyarrow={2}', matrix.os, matrix.env_file, matrix.pyarrow_version) }}
3535
concurrency:
3636
# https://github.community/t/concurrecy-not-work-for-push/183068/7
37-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-${{ matrix.env_file }}-${{ matrix.pyarrow_version }}-mac-win
37+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.os }}
3838
cancel-in-progress: true
3939

4040
steps:

.github/workflows/posix.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -155,24 +155,11 @@ jobs:
155155
channel-priority: flexible
156156
environment-file: ${{ env.ENV_FILE }}
157157
use-only-tar-bz2: true
158-
if: ${{ env.IS_PYPY == 'false' }} # No pypy3.8 support
159158

160159
- name: Upgrade Arrow version
161160
run: conda install -n pandas-dev -c conda-forge --no-update-deps pyarrow=${{ matrix.pyarrow_version }}
162161
if: ${{ matrix.pyarrow_version }}
163162

164-
- name: Setup PyPy
165-
uses: actions/setup-python@v3
166-
with:
167-
python-version: "pypy-3.8"
168-
if: ${{ env.IS_PYPY == 'true' }}
169-
170-
- name: Setup PyPy dependencies
171-
run: |
172-
# TODO: re-enable cov, its slowing the tests down though
173-
pip install Cython numpy python-dateutil pytz pytest>=6.0 pytest-xdist>=1.31.0 pytest-asyncio>=0.17 hypothesis>=5.5.3
174-
if: ${{ env.IS_PYPY == 'true' }}
175-
176163
- name: Build Pandas
177164
uses: ./.github/actions/build_pandas
178165

.github/workflows/python-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Unfreeze(by commentingthe if: false() condition) once the
33
# next Python Dev version has released beta 1 and both Cython and numpy support it
44
# After that Python has released, migrate the workflows to the
5-
# posix GHA workflows/Azure pipelines and "freeze" this file by
5+
# posix GHA workflows and "freeze" this file by
66
# uncommenting the if: false() condition
77
# Feel free to modify this comment as necessary.
88

.github/workflows/windows.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ repos:
8989
types: [python]
9090
stages: [manual]
9191
# note: keep version in sync with .github/workflows/code-checks.yml
92-
additional_dependencies: ['pyright@1.1.245']
92+
additional_dependencies: ['pyright@1.1.247']
9393
- repo: local
9494
hooks:
9595
- id: flake8-rst

LICENSES/ULTRAJSON_LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Portions of code from MODP_ASCII - Ascii transformations (upper/lower, etc)
2828
https://github.com/client9/stringencoders
2929
Copyright (c) 2007 Nick Galbreath -- nickg [at] modp [dot] com. All rights reserved.
3030

31-
Numeric decoder derived from from TCL library
31+
Numeric decoder derived from TCL library
3232
http://www.opensource.apple.com/source/tcl/tcl-14/tcl/license.terms
3333
* Copyright (c) 1988-1993 The Regents of the University of California.
3434
* Copyright (c) 1994 Sun Microsystems, Inc.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3509134.svg)](https://doi.org/10.5281/zenodo.3509134)
1111
[![Package Status](https://img.shields.io/pypi/status/pandas.svg)](https://pypi.org/project/pandas/)
1212
[![License](https://img.shields.io/pypi/l/pandas.svg)](https://github.com/pandas-dev/pandas/blob/main/LICENSE)
13-
[![Azure Build Status](https://dev.azure.com/pandas-dev/pandas/_apis/build/status/pandas-dev.pandas?branch=main)](https://dev.azure.com/pandas-dev/pandas/_build/latest?definitionId=1&branch=main)
1413
[![Coverage](https://codecov.io/github/pandas-dev/pandas/coverage.svg?branch=main)](https://codecov.io/gh/pandas-dev/pandas)
1514
[![Downloads](https://static.pepy.tech/personalized-badge/pandas?period=month&units=international_system&left_color=black&right_color=orange&left_text=PyPI%20downloads%20per%20month)](https://pepy.tech/project/pandas)
1615
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pydata/pandas)

asv_bench/benchmarks/gil.py

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from functools import wraps
2+
import threading
3+
14
import numpy as np
25

36
from pandas import (
@@ -30,21 +33,57 @@
3033
from pandas._libs import algos
3134
except ImportError:
3235
from pandas import algos
33-
try:
34-
from pandas._testing import test_parallel # noqa: PDF014
3536

36-
have_real_test_parallel = True
37-
except ImportError:
38-
have_real_test_parallel = False
3937

40-
def test_parallel(num_threads=1):
41-
def wrapper(fname):
42-
return fname
38+
from .pandas_vb_common import BaseIO # isort:skip
4339

44-
return wrapper
4540

41+
def test_parallel(num_threads=2, kwargs_list=None):
42+
"""
43+
Decorator to run the same function multiple times in parallel.
4644
47-
from .pandas_vb_common import BaseIO # isort:skip
45+
Parameters
46+
----------
47+
num_threads : int, optional
48+
The number of times the function is run in parallel.
49+
kwargs_list : list of dicts, optional
50+
The list of kwargs to update original
51+
function kwargs on different threads.
52+
53+
Notes
54+
-----
55+
This decorator does not pass the return value of the decorated function.
56+
57+
Original from scikit-image:
58+
59+
https://github.com/scikit-image/scikit-image/pull/1519
60+
61+
"""
62+
assert num_threads > 0
63+
has_kwargs_list = kwargs_list is not None
64+
if has_kwargs_list:
65+
assert len(kwargs_list) == num_threads
66+
67+
def wrapper(func):
68+
@wraps(func)
69+
def inner(*args, **kwargs):
70+
if has_kwargs_list:
71+
update_kwargs = lambda i: dict(kwargs, **kwargs_list[i])
72+
else:
73+
update_kwargs = lambda i: kwargs
74+
threads = []
75+
for i in range(num_threads):
76+
updated_kwargs = update_kwargs(i)
77+
thread = threading.Thread(target=func, args=args, kwargs=updated_kwargs)
78+
threads.append(thread)
79+
for thread in threads:
80+
thread.start()
81+
for thread in threads:
82+
thread.join()
83+
84+
return inner
85+
86+
return wrapper
4887

4988

5089
class ParallelGroupbyMethods:
@@ -53,8 +92,7 @@ class ParallelGroupbyMethods:
5392
param_names = ["threads", "method"]
5493

5594
def setup(self, threads, method):
56-
if not have_real_test_parallel:
57-
raise NotImplementedError
95+
5896
N = 10**6
5997
ngroups = 10**3
6098
df = DataFrame(
@@ -86,8 +124,7 @@ class ParallelGroups:
86124
param_names = ["threads"]
87125

88126
def setup(self, threads):
89-
if not have_real_test_parallel:
90-
raise NotImplementedError
127+
91128
size = 2**22
92129
ngroups = 10**3
93130
data = Series(np.random.randint(0, ngroups, size=size))
@@ -108,8 +145,7 @@ class ParallelTake1D:
108145
param_names = ["dtype"]
109146

110147
def setup(self, dtype):
111-
if not have_real_test_parallel:
112-
raise NotImplementedError
148+
113149
N = 10**6
114150
df = DataFrame({"col": np.arange(N, dtype=dtype)})
115151
indexer = np.arange(100, len(df) - 100)
@@ -131,8 +167,7 @@ class ParallelKth:
131167
repeat = 5
132168

133169
def setup(self):
134-
if not have_real_test_parallel:
135-
raise NotImplementedError
170+
136171
N = 10**7
137172
k = 5 * 10**5
138173
kwargs_list = [{"arr": np.random.randn(N)}, {"arr": np.random.randn(N)}]
@@ -149,8 +184,7 @@ def time_kth_smallest(self):
149184

150185
class ParallelDatetimeFields:
151186
def setup(self):
152-
if not have_real_test_parallel:
153-
raise NotImplementedError
187+
154188
N = 10**6
155189
self.dti = date_range("1900-01-01", periods=N, freq="T")
156190
self.period = self.dti.to_period("D")
@@ -204,8 +238,7 @@ class ParallelRolling:
204238
param_names = ["method"]
205239

206240
def setup(self, method):
207-
if not have_real_test_parallel:
208-
raise NotImplementedError
241+
209242
win = 100
210243
arr = np.random.rand(100000)
211244
if hasattr(DataFrame, "rolling"):
@@ -248,8 +281,7 @@ class ParallelReadCSV(BaseIO):
248281
param_names = ["dtype"]
249282

250283
def setup(self, dtype):
251-
if not have_real_test_parallel:
252-
raise NotImplementedError
284+
253285
rows = 10000
254286
cols = 50
255287
data = {
@@ -284,8 +316,6 @@ class ParallelFactorize:
284316
param_names = ["threads"]
285317

286318
def setup(self, threads):
287-
if not have_real_test_parallel:
288-
raise NotImplementedError
289319

290320
strings = tm.makeStringIndex(100000)
291321

asv_bench/benchmarks/sparse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ def setup(self, fill_value):
146146

147147
def make_block_array(self, length, num_blocks, block_size, fill_value):
148148
arr = np.full(length, fill_value)
149-
indicies = np.random.choice(
149+
indices = np.random.choice(
150150
np.arange(0, length, block_size), num_blocks, replace=False
151151
)
152-
for ind in indicies:
152+
for ind in indices:
153153
arr[ind : ind + block_size] = np.random.randint(0, 100, block_size)
154154
return SparseArray(arr, fill_value=fill_value)
155155

asv_bench/benchmarks/strings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def time_get_dummies(self, dtype):
268268

269269
class Encode:
270270
def setup(self):
271-
self.ser = Series(tm.makeUnicodeIndex())
271+
self.ser = Series(tm.makeStringIndex())
272272

273273
def time_encode_decode(self):
274274
self.ser.str.encode("utf-8").str.decode("utf-8")

0 commit comments

Comments
 (0)