Skip to content

Commit 6b58618

Browse files
author
MarcoGorelli
committed
Merge remote-tracking branch 'upstream/main' into gh-49298
2 parents 5884f4e + ad98c2b commit 6b58618

File tree

67 files changed

+738
-2406
lines changed

Some content is hidden

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

67 files changed

+738
-2406
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \
3939
. ~/virtualenvs/pandas-dev/bin/activate && \
4040
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
41-
pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
41+
python -m pip install versioneer[toml] && \
42+
python -m pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
4243
python setup.py build_ext -q -j1 && \
4344
python -m pip install --no-build-isolation --no-use-pep517 -e . && \
4445
python -m pip list && \

.github/workflows/code-checks.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ jobs:
7979
run: ci/code_checks.sh docstrings
8080
if: ${{ steps.build.outcome == 'success' && always() }}
8181

82+
- name: Run check of documentation notebooks
83+
run: ci/code_checks.sh notebooks
84+
if: ${{ steps.build.outcome == 'success' && always() }}
85+
8286
- name: Use existing environment for type checking
8387
run: |
8488
echo $PATH >> $GITHUB_PATH

.github/workflows/docbuild-and-upload.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ jobs:
5454
- name: Build documentation zip
5555
run: doc/make.py zip_html
5656

57-
- name: Build the interactive terminal
58-
run: |
59-
cd web/interactive_terminal
60-
jupyter lite build
61-
6257
- name: Install ssh key
6358
run: |
6459
mkdir -m 700 -p ~/.ssh

.github/workflows/package-checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
- name: Install required dependencies
4444
run: |
4545
python -m pip install --upgrade pip setuptools wheel python-dateutil pytz numpy cython
46+
python -m pip install versioneer[toml]
4647
shell: bash -el {0}
4748

4849
- name: Pip install with extra

.github/workflows/python-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
python -m pip install --upgrade pip setuptools wheel
7676
python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
7777
python -m pip install git+https://github.com/nedbat/coveragepy.git
78+
python -m pip install versioneer[toml]
7879
python -m pip install python-dateutil pytz cython hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-cov pytest-asyncio>=0.17
7980
python -m pip list
8081

.github/workflows/sdist.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
- name: Install dependencies
4848
run: |
4949
python -m pip install --upgrade pip setuptools wheel
50+
python -m pip install versioneer[toml]
5051
5152
# GH 39416
5253
pip install numpy

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ repos:
2626
hooks:
2727
- id: codespell
2828
types_or: [python, rst, markdown]
29+
additional_dependencies: [tomli]
2930
- repo: https://github.com/MarcoGorelli/cython-lint
3031
rev: v0.2.1
3132
hooks:

asv_bench/benchmarks/frame_ctor.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -205,21 +205,4 @@ def time_frame_from_arrays_sparse(self):
205205
)
206206

207207

208-
class From3rdParty:
209-
# GH#44616
210-
211-
def setup(self):
212-
try:
213-
import torch
214-
except ImportError:
215-
raise NotImplementedError
216-
217-
row = 700000
218-
col = 64
219-
self.val_tensor = torch.randn(row, col)
220-
221-
def time_from_torch(self):
222-
DataFrame(self.val_tensor)
223-
224-
225208
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/indexing.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
lower-level methods directly on Index and subclasses, see index_object.py,
44
indexing_engine.py, and index_cached.py
55
"""
6-
import itertools
7-
import string
86
import warnings
97

108
import numpy as np
@@ -353,15 +351,13 @@ def setup(self, index):
353351
"non_monotonic": CategoricalIndex(list("abc" * N)),
354352
}
355353
self.data = indices[index]
356-
self.data_unique = CategoricalIndex(
357-
["".join(perm) for perm in itertools.permutations(string.printable, 3)]
358-
)
354+
self.data_unique = CategoricalIndex([str(i) for i in range(N * 3)])
359355

360356
self.int_scalar = 10000
361357
self.int_list = list(range(10000))
362358

363359
self.cat_scalar = "b"
364-
self.cat_list = ["a", "c"]
360+
self.cat_list = ["1", "3"]
365361

366362
def time_getitem_scalar(self, index):
367363
self.data[self.int_scalar]

ci/code_checks.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
# $ ./ci/code_checks.sh doctests # run doctests
1313
# $ ./ci/code_checks.sh docstrings # validate docstring errors
1414
# $ ./ci/code_checks.sh single-docs # check single-page docs build warning-free
15+
# $ ./ci/code_checks.sh notebooks # check execution of documentation notebooks
1516

16-
[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" ]] || \
17-
{ echo "Unknown command $1. Usage: $0 [code|doctests|docstrings]"; exit 9999; }
17+
[[ -z "$1" || "$1" == "code" || "$1" == "doctests" || "$1" == "docstrings" || "$1" == "single-docs" || "$1" == "notebooks" ]] || \
18+
{ echo "Unknown command $1. Usage: $0 [code|doctests|docstrings|single-docs|notebooks]"; exit 9999; }
1819

1920
BASE_DIR="$(dirname $0)/.."
2021
RET=0
@@ -84,6 +85,15 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8485

8586
fi
8687

88+
### DOCUMENTATION NOTEBOOKS ###
89+
if [[ -z "$CHECK" || "$CHECK" == "notebooks" ]]; then
90+
91+
MSG='Notebooks' ; echo $MSG
92+
jupyter nbconvert --execute $(find doc/source -name '*.ipynb') --to notebook
93+
RET=$(($RET + $?)) ; echo $MSG "DONE"
94+
95+
fi
96+
8797
### SINGLE-PAGE DOCS ###
8898
if [[ -z "$CHECK" || "$CHECK" == "single-docs" ]]; then
8999
python doc/make.py --warnings-are-errors --single pandas.Series.value_counts

ci/deps/actions-310-numpydev.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ channels:
44
dependencies:
55
- python=3.10
66

7-
# tools
7+
# build dependencies
8+
- versioneer[toml]
9+
10+
# test dependencies
811
- pytest>=6.0
912
- pytest-cov
1013
- pytest-xdist>=1.31

ci/deps/actions-310.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ channels:
44
dependencies:
55
- python=3.10
66

7-
# test dependencies
7+
# build dependencies
8+
- versioneer[toml]
89
- cython>=0.29.32
10+
11+
# test dependencies
912
- pytest>=6.0
1013
- pytest-cov
1114
- pytest-xdist>=1.31

ci/deps/actions-38-downstream_compat.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ channels:
55
dependencies:
66
- python=3.8
77

8-
# test dependencies
8+
# build dependencies
9+
- versioneer[toml]
910
- cython>=0.29.32
11+
12+
# test dependencies
1013
- pytest>=6.0
1114
- pytest-cov
1215
- pytest-xdist>=1.31
@@ -67,4 +70,3 @@ dependencies:
6770
- pandas-datareader
6871
- pyyaml
6972
- py
70-
- pytorch

ci/deps/actions-38-minimum_versions.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ channels:
66
dependencies:
77
- python=3.8.0
88

9-
# test dependencies
9+
# build dependencies
10+
- versioneer[toml]
1011
- cython>=0.29.32
12+
13+
# test dependencies
1114
- pytest>=6.0
1215
- pytest-cov
1316
- pytest-xdist>=1.31

ci/deps/actions-38.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ channels:
44
dependencies:
55
- python=3.8
66

7-
# test dependencies
7+
# build dependencies
8+
- versioneer[toml]
89
- cython>=0.29.32
10+
11+
# test dependencies
912
- pytest>=6.0
1013
- pytest-cov
1114
- pytest-xdist>=1.31

ci/deps/actions-39.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ channels:
44
dependencies:
55
- python=3.9
66

7-
# test dependencies
7+
# build dependencies
8+
- versioneer[toml]
89
- cython>=0.29.32
10+
11+
# test dependencies
912
- pytest>=6.0
1013
- pytest-cov
1114
- pytest-xdist>=1.31

ci/deps/actions-pypy-38.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ dependencies:
77
# with base pandas has been dealt with
88
- python=3.8[build=*_pypy] # TODO: use this once pypy3.8 is available
99

10-
# tools
10+
# build dependencies
11+
- versioneer[toml]
1112
- cython>=0.29.32
13+
14+
# test dependencies
1215
- pytest>=6.0
1316
- pytest-cov
1417
- pytest-asyncio

ci/deps/circle-38-arm64.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ channels:
44
dependencies:
55
- python=3.8
66

7-
# test dependencies
7+
# build dependencies
8+
- versioneer[toml]
89
- cython>=0.29.32
10+
11+
# test dependencies
912
- pytest>=6.0
1013
- pytest-cov
1114
- pytest-xdist>=1.31

doc/source/development/contributing_codebase.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,14 @@ install pandas) by typing::
777777

778778
pytest pandas
779779

780+
.. note::
781+
782+
If a handful of tests don't pass, it may not be an issue with your pandas installation.
783+
Some tests (e.g. some SQLAlchemy ones) require additional setup, others might start
784+
failing because a non-pinned library released a new version, and others might be flaky
785+
if run in parallel. As long as you can import pandas from your locally built version,
786+
your installation is probably fine and you can start contributing!
787+
780788
Often it is worth running only a subset of tests first around your changes before running the
781789
entire suite.
782790

0 commit comments

Comments
 (0)