Skip to content

Commit 93be04f

Browse files
Merge remote-tracking branch 'upstream/main' into uncertainties
Needed in order to fix broken reduce operations (pandas-dev#52788). Signed-off-by: Michael Tiemann <[email protected]>
2 parents b8083a9 + 3c01ce2 commit 93be04f

File tree

397 files changed

+6818
-3355
lines changed

Some content is hidden

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

397 files changed

+6818
-3355
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ web/ @datapythonista
99

1010
# docs
1111
doc/cheatsheet @Dr-Irv
12+
doc/source/development @noatamir
1213

1314
# pandas
1415
pandas/_libs/ @WillAyd

.github/actions/build_pandas/action.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ runs:
1212
run: |
1313
micromamba info
1414
micromamba list
15+
pip list --pre
1516
shell: bash -el {0}
1617

1718
- name: Uninstall existing Pandas installation
1819
run: |
19-
if pip list | grep -q ^pandas; then
20-
pip uninstall -y pandas || true
20+
if pip show pandas 1>/dev/null; then
21+
pip uninstall -y pandas
2122
fi
2223
shell: bash -el {0}
2324

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Purge caches once a week
2+
on:
3+
schedule:
4+
# 4:10 UTC on Sunday
5+
- cron: "10 4 * * 0"
6+
7+
jobs:
8+
cleanup:
9+
runs-on: ubuntu-latest
10+
if: github.repository_owner == 'pandas-dev'
11+
permissions:
12+
actions: write
13+
steps:
14+
- name: Clean Cache
15+
run: |
16+
gh extension install actions/gh-actions-cache
17+
18+
REPO=${{ github.repository }}
19+
20+
echo "Fetching list of cache key"
21+
allCaches=$(gh actions-cache list -L 100 -R $REPO | cut -f 1 )
22+
23+
## Setting this to not fail the workflow while deleting cache keys.
24+
set +e
25+
echo "Deleting caches..."
26+
for cacheKey in $allCaches
27+
do
28+
gh actions-cache delete $cacheKey -R $REPO --confirm
29+
done
30+
echo "Done"
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/unit-tests.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@ jobs:
5757
# Also install zh_CN (its encoding is gb2312) but do not activate it.
5858
# It will be temporarily activated during tests with locale.setlocale
5959
extra_loc: "zh_CN"
60-
- name: "Copy-on-Write"
60+
- name: "Copy-on-Write 3.9"
61+
env_file: actions-39.yaml
62+
pattern: "not slow and not network and not single_cpu"
63+
pandas_copy_on_write: "1"
64+
- name: "Copy-on-Write 3.10"
65+
env_file: actions-310.yaml
66+
pattern: "not slow and not network and not single_cpu"
67+
pandas_copy_on_write: "1"
68+
- name: "Copy-on-Write 3.11"
6169
env_file: actions-311.yaml
6270
pattern: "not slow and not network and not single_cpu"
6371
pandas_copy_on_write: "1"
@@ -165,7 +173,7 @@ jobs:
165173
uses: ./.github/actions/run-tests
166174
env:
167175
PATTERN: 'single_cpu'
168-
PYTEST_WORKERS: 1
176+
PYTEST_WORKERS: 0
169177
if: ${{ matrix.pattern == '' && (always() && steps.build.outcome == 'success')}}
170178

171179
macos-windows:
@@ -185,8 +193,8 @@ jobs:
185193
PANDAS_CI: 1
186194
PYTEST_TARGET: pandas
187195
PATTERN: "not slow and not db and not network and not single_cpu"
188-
# GH 47443: PYTEST_WORKERS > 1 crashes Windows builds with memory related errors
189-
PYTEST_WORKERS: ${{ matrix.os == 'macos-latest' && 'auto' || '1' }}
196+
# GH 47443: PYTEST_WORKERS > 0 crashes Windows builds with memory related errors
197+
PYTEST_WORKERS: ${{ matrix.os == 'macos-latest' && 'auto' || '0' }}
190198

191199
steps:
192200
- name: Checkout

.github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
path: ./dist
111111

112112
- name: Build wheels
113-
uses: pypa/cibuildwheel@v2.13.1
113+
uses: pypa/cibuildwheel@v2.14.1
114114
# TODO: Build wheels from sdist again
115115
# There's some sort of weird race condition?
116116
# within Github that makes the sdist be missing files

.gitpod.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
# https://www.gitpod.io/docs/config-start-tasks/#configuring-the-terminal
44
# -------------------------------------------------------------------------
55

6-
# assuming we use dockerhub: name of the docker user, docker image, tag, e.g. https://hub.docker.com/r/pandas/pandas-gitpod/tags
7-
image: pandas/pandas-gitpod:latest
6+
# images for gitpod pandas are in https://hub.docker.com/r/pandas/pandas-gitpod/tags
7+
# we're using the Dockerfile in the base of the repo
8+
image:
9+
file: Dockerfile
810
tasks:
911
- name: Prepare development environment
1012
init: |
1113
mkdir -p .vscode
1214
cp gitpod/settings.json .vscode/settings.json
13-
conda activate pandas-dev
14-
git pull --unshallow # need to force this else the prebuild fails
1515
git fetch --tags
16-
python setup.py build_ext --inplace -j 4
17-
echo "🛠 Completed rebuilding Pandas!! 🛠 "
16+
python -m pip install -ve . --no-build-isolation --config-settings editable-verbose=true
1817
pre-commit install
18+
command: |
19+
python -m pip install -ve . --no-build-isolation --config-settings editable-verbose=true
1920
echo "✨ Pre-build complete! You can close this terminal ✨ "
2021
2122
# --------------------------------------------------------
@@ -37,7 +38,7 @@ vscode:
3738
# avoid adding too many. they each open a pop-up window
3839

3940
# --------------------------------------------------------
40-
# using prebuilds for the container
41+
# Using prebuilds for the container
4142
# With this configuration the prebuild will happen on push to main
4243
github:
4344
prebuilds:

.pre-commit-config.yaml

+29-66
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,13 @@ default_stages: [
1515
ci:
1616
autofix_prs: false
1717
repos:
18-
- repo: local
18+
- repo: https://github.com/hauntsaninja/black-pre-commit-mirror
19+
# black compiled with mypyc
20+
rev: 23.3.0
1921
hooks:
20-
# NOTE: we make `black` a local hook because if it's installed from
21-
# PyPI (rather than from source) then it'll run twice as fast thanks to mypyc
22-
- id: black
23-
name: black
24-
description: "Black: The uncompromising Python code formatter"
25-
entry: black
26-
language: python
27-
require_serial: true
28-
types_or: [python, pyi]
29-
additional_dependencies: [black==23.3.0]
30-
- repo: https://github.com/charliermarsh/ruff-pre-commit
31-
rev: v0.0.270
22+
- id: black
23+
- repo: https://github.com/astral-sh/ruff-pre-commit
24+
rev: v0.0.277
3225
hooks:
3326
- id: ruff
3427
args: [--exit-non-zero-on-fix]
@@ -40,7 +33,7 @@ repos:
4033
pass_filenames: true
4134
require_serial: false
4235
- repo: https://github.com/codespell-project/codespell
43-
rev: v2.2.4
36+
rev: v2.2.5
4437
hooks:
4538
- id: codespell
4639
types_or: [python, rst, markdown, cython, c]
@@ -53,14 +46,22 @@ repos:
5346
- repo: https://github.com/pre-commit/pre-commit-hooks
5447
rev: v4.4.0
5548
hooks:
49+
- id: check-ast
50+
- id: check-case-conflict
51+
- id: check-toml
52+
- id: check-xml
53+
- id: check-yaml
54+
exclude: ^ci/meta.yaml$
5655
- id: debug-statements
5756
- id: end-of-file-fixer
5857
exclude: \.txt$
59-
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg,
60-
post-checkout, post-commit, post-merge, post-rewrite]
58+
- id: mixed-line-ending
59+
args: [--fix=auto]
60+
exclude: ^pandas/tests/io/parser/data/utf16_ex.txt$
61+
- id: fix-byte-order-marker
62+
- id: fix-encoding-pragma
63+
args: [--remove]
6164
- id: trailing-whitespace
62-
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg,
63-
post-checkout, post-commit, post-merge, post-rewrite]
6465
- repo: https://github.com/cpplint/cpplint
6566
rev: 1.6.1
6667
hooks:
@@ -74,7 +75,7 @@ repos:
7475
--linelength=88,
7576
'--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size'
7677
]
77-
- repo: https://github.com/pycqa/pylint
78+
- repo: https://github.com/pylint-dev/pylint
7879
rev: v3.0.0a6
7980
hooks:
8081
- id: pylint
@@ -93,23 +94,20 @@ repos:
9394
|^pandas/conftest\.py # keep excluded
9495
args: [--disable=all, --enable=redefined-outer-name]
9596
stages: [manual]
96-
- id: pylint
97-
alias: unspecified-encoding
98-
name: Using open without explicitly specifying an encoding
99-
args: [--disable=all, --enable=unspecified-encoding]
100-
stages: [manual]
10197
- repo: https://github.com/PyCQA/isort
10298
rev: 5.12.0
10399
hooks:
104100
- id: isort
105101
- repo: https://github.com/asottile/pyupgrade
106-
rev: v3.4.0
102+
rev: v3.7.0
107103
hooks:
108104
- id: pyupgrade
109-
args: [--py38-plus]
105+
args: [--py39-plus]
110106
- repo: https://github.com/pre-commit/pygrep-hooks
111107
rev: v1.10.0
112108
hooks:
109+
- id: python-check-blanket-noqa
110+
- id: python-check-blanket-type-ignore
113111
- id: rst-backticks
114112
- id: rst-directive-colons
115113
types: [text] # overwrite types: [rst]
@@ -132,7 +130,7 @@ repos:
132130
types: [python]
133131
stages: [manual]
134132
additional_dependencies: &pyright_dependencies
135-
133+
136134
- id: pyright_reportGeneralTypeIssues
137135
# note: assumes python env is setup and activated
138136
name: pyright reportGeneralTypeIssues
@@ -166,34 +164,17 @@ repos:
166164
exclude: ^pandas/core/interchange/
167165
language: python
168166
types: [python]
169-
- id: no-os-remove
170-
name: Check code for instances of os.remove
171-
entry: os\.remove
172-
language: pygrep
173-
types: [python]
174-
files: ^pandas/tests/
175-
exclude: |
176-
(?x)^
177-
pandas/tests/io/pytables/test_store\.py$
178167
- id: unwanted-patterns
179168
name: Unwanted patterns
180169
language: pygrep
181170
entry: |
182171
(?x)
183-
# outdated annotation syntax, missing error codes
172+
# outdated annotation syntax
184173
\#\ type:\ (?!ignore)
185-
|\#\ type:\s?ignore(?!\[)
186174
187175
# foo._class__ instead of type(foo)
188176
|\.__class__
189177
190-
# np.bool/np.object instead of np.bool_/np.object_
191-
|np\.bool[^_8`]
192-
|np\.object[^_8`]
193-
194-
# imports from collections.abc instead of `from collections import abc`
195-
|from\ collections\.abc\ import
196-
197178
# Numpy
198179
|from\ numpy\ import\ random
199180
|from\ numpy\.random\ import
@@ -212,16 +193,8 @@ repos:
212193
213194
# builtin filter function
214195
|(?<!def)[\(\s]filter\(
215-
216-
# exec
217-
|[^a-zA-Z0-9_]exec\(
218196
types_or: [python, cython, rst]
219197
exclude: ^doc/source/development/code_style\.rst # contains examples of patterns to avoid
220-
- id: cython-casting
221-
name: Check Cython casting is `<type>obj`, not `<type> obj`
222-
language: pygrep
223-
entry: '[a-zA-Z0-9*]> '
224-
files: (\.pyx|\.pxi.in)$
225198
- id: incorrect-backticks
226199
name: Check for backticks incorrectly rendering because of missing spaces
227200
language: pygrep
@@ -234,19 +207,6 @@ repos:
234207
entry: 'np\.random\.seed'
235208
files: ^asv_bench/benchmarks
236209
exclude: ^asv_bench/benchmarks/pandas_vb_common\.py
237-
- id: np-testing-array-equal
238-
name: Check for usage of numpy testing or array_equal
239-
language: pygrep
240-
entry: '(numpy|np)(\.testing|\.array_equal)'
241-
files: ^pandas/tests/
242-
types: [python]
243-
- id: invalid-ea-testing
244-
name: Check for invalid EA testing
245-
language: pygrep
246-
entry: 'tm\.assert_(series|frame)_equal'
247-
files: ^pandas/tests/extension/base
248-
types: [python]
249-
exclude: ^pandas/tests/extension/base/base\.py
250210
- id: unwanted-patterns-in-tests
251211
name: Unwanted patterns in tests
252212
language: pygrep
@@ -280,6 +240,9 @@ repos:
280240
281241
# pytest.warns (use tm.assert_produces_warning instead)
282242
|pytest\.warns
243+
244+
# os.remove
245+
|os\.remove
283246
files: ^pandas/tests/
284247
types_or: [python, cython, rst]
285248
- id: unwanted-patterns-in-ea-tests

README.md

+8-12
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@
55
-----------------
66

77
# pandas: powerful Python data analysis toolkit
8-
[![PyPI Latest Release](https://img.shields.io/pypi/v/pandas.svg)](https://pypi.org/project/pandas/)
9-
[![Conda Latest Release](https://anaconda.org/conda-forge/pandas/badges/version.svg)](https://anaconda.org/anaconda/pandas/)
10-
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3509134.svg)](https://doi.org/10.5281/zenodo.3509134)
11-
[![Package Status](https://img.shields.io/pypi/status/pandas.svg)](https://pypi.org/project/pandas/)
12-
[![License](https://img.shields.io/pypi/l/pandas.svg)](https://github.com/pandas-dev/pandas/blob/main/LICENSE)
13-
[![Coverage](https://codecov.io/github/pandas-dev/pandas/coverage.svg?branch=main)](https://codecov.io/gh/pandas-dev/pandas)
14-
[![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)
15-
[![Slack](https://img.shields.io/badge/join_Slack-information-brightgreen.svg?logo=slack)](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack)
16-
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org)
17-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
18-
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
8+
9+
| | |
10+
| --- | --- |
11+
| Testing | [![CI - Test](https://github.com/pandas-dev/pandas/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/pandas-dev/pandas/actions/workflows/unit-tests.yml) [![Coverage](https://codecov.io/github/pandas-dev/pandas/coverage.svg?branch=main)](https://codecov.io/gh/pandas-dev/pandas) |
12+
| Package | [![PyPI Latest Release](https://img.shields.io/pypi/v/pandas.svg)](https://pypi.org/project/pandas/) [![PyPI Downloads](https://img.shields.io/pypi/dm/pandas.svg?label=PyPI%20downloads)](https://pypi.org/project/pandas/) [![Conda Latest Release](https://anaconda.org/conda-forge/pandas/badges/version.svg)](https://anaconda.org/conda-forge/pandas) [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/pandas.svg?label=Conda%20downloads)](https://anaconda.org/conda-forge/pandas) |
13+
| Meta | [![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3509134.svg)](https://doi.org/10.5281/zenodo.3509134) [![License - BSD 3-Clause](https://img.shields.io/pypi/l/pandas.svg)](https://github.com/pandas-dev/pandas/blob/main/LICENSE) [![Slack](https://img.shields.io/badge/join_Slack-information-brightgreen.svg?logo=slack)](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack) |
14+
1915

2016
## What is it?
2117

@@ -156,7 +152,7 @@ See the full instructions for [installing from source](https://pandas.pydata.org
156152
[BSD 3](LICENSE)
157153

158154
## Documentation
159-
The official documentation is hosted on PyData.org: https://pandas.pydata.org/pandas-docs/stable
155+
The official documentation is hosted on [PyData.org](https://pandas.pydata.org/pandas-docs/stable/).
160156

161157
## Background
162158
Work on ``pandas`` started at [AQR](https://www.aqr.com/) (a quantitative hedge fund) in 2008 and

0 commit comments

Comments
 (0)