Skip to content

Commit 1b1ab72

Browse files
Merge remote-tracking branch 'upstream/master' into fix_interpolate_limit_area_and_limit_direction_with_pad
2 parents c2473f2 + 6929e26 commit 1b1ab72

File tree

407 files changed

+11943
-5296
lines changed

Some content is hidden

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

407 files changed

+11943
-5296
lines changed

.github/workflows/stale-pr.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Stale PRs"
2+
on:
3+
schedule:
4+
# * is a special character in YAML so you have to quote this string
5+
- cron: "0 */6 * * *"
6+
7+
jobs:
8+
stale:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/stale@v3
12+
with:
13+
repo-token: ${{ secrets.GITHUB_TOKEN }}
14+
stale-pr-message: "This pull request is stale because it has been open for thirty days with no activity."
15+
skip-stale-pr-message: false
16+
stale-pr-label: "Stale"
17+
exempt-pr-labels: "Needs Review,Blocked"
18+
days-before-stale: 30
19+
days-before-close: -1
20+
remove-stale-when-updated: true
21+
debug-only: true

.pre-commit-config.yaml

-12
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,3 @@ repos:
3030
- id: isort
3131
language: python_venv
3232
exclude: ^pandas/__init__\.py$|^pandas/core/api\.py$
33-
- repo: https://github.com/pre-commit/mirrors-mypy
34-
rev: v0.730
35-
hooks:
36-
- id: mypy
37-
args:
38-
# As long as a some files are excluded from check-untyped-defs
39-
# we have to exclude it from the pre-commit hook as the configuration
40-
# is based on modules but the hook runs on files.
41-
- --no-check-untyped-defs
42-
- --follow-imports
43-
- skip
44-
files: pandas/

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,16 @@ doc:
2525
cd doc; \
2626
python make.py clean; \
2727
python make.py html
28+
29+
check:
30+
python3 scripts/validate_unwanted_patterns.py \
31+
--validation-type="private_function_across_module" \
32+
--included-file-extensions="py" \
33+
--excluded-file-paths=pandas/tests,asv_bench/,pandas/_vendored \
34+
pandas/
35+
36+
python3 scripts/validate_unwanted_patterns.py \
37+
--validation-type="private_import_across_module" \
38+
--included-file-extensions="py" \
39+
--excluded-file-paths=pandas/tests,asv_bench/,pandas/_vendored,doc/
40+
pandas/

asv_bench/asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// The Pythons you'd like to test against. If not provided, defaults
2727
// to the current version of Python used to run `asv`.
2828
// "pythons": ["2.7", "3.4"],
29-
"pythons": ["3.6"],
29+
"pythons": ["3.8"],
3030

3131
// The matrix of dependencies to test. Each key is the name of a
3232
// package (in PyPI) and the values are version numbers. An empty

asv_bench/benchmarks/groupby.py

+32-14
Original file line numberDiff line numberDiff line change
@@ -627,49 +627,63 @@ def time_first(self):
627627

628628

629629
class TransformEngine:
630-
def setup(self):
630+
631+
param_names = ["parallel"]
632+
params = [[True, False]]
633+
634+
def setup(self, parallel):
631635
N = 10 ** 3
632636
data = DataFrame(
633637
{0: [str(i) for i in range(100)] * N, 1: list(range(100)) * N},
634638
columns=[0, 1],
635639
)
640+
self.parallel = parallel
636641
self.grouper = data.groupby(0)
637642

638-
def time_series_numba(self):
643+
def time_series_numba(self, parallel):
639644
def function(values, index):
640645
return values * 5
641646

642-
self.grouper[1].transform(function, engine="numba")
647+
self.grouper[1].transform(
648+
function, engine="numba", engine_kwargs={"parallel": self.parallel}
649+
)
643650

644-
def time_series_cython(self):
651+
def time_series_cython(self, parallel):
645652
def function(values):
646653
return values * 5
647654

648655
self.grouper[1].transform(function, engine="cython")
649656

650-
def time_dataframe_numba(self):
657+
def time_dataframe_numba(self, parallel):
651658
def function(values, index):
652659
return values * 5
653660

654-
self.grouper.transform(function, engine="numba")
661+
self.grouper.transform(
662+
function, engine="numba", engine_kwargs={"parallel": self.parallel}
663+
)
655664

656-
def time_dataframe_cython(self):
665+
def time_dataframe_cython(self, parallel):
657666
def function(values):
658667
return values * 5
659668

660669
self.grouper.transform(function, engine="cython")
661670

662671

663672
class AggEngine:
664-
def setup(self):
673+
674+
param_names = ["parallel"]
675+
params = [[True, False]]
676+
677+
def setup(self, parallel):
665678
N = 10 ** 3
666679
data = DataFrame(
667680
{0: [str(i) for i in range(100)] * N, 1: list(range(100)) * N},
668681
columns=[0, 1],
669682
)
683+
self.parallel = parallel
670684
self.grouper = data.groupby(0)
671685

672-
def time_series_numba(self):
686+
def time_series_numba(self, parallel):
673687
def function(values, index):
674688
total = 0
675689
for i, value in enumerate(values):
@@ -679,9 +693,11 @@ def function(values, index):
679693
total += value * 2
680694
return total
681695

682-
self.grouper[1].agg(function, engine="numba")
696+
self.grouper[1].agg(
697+
function, engine="numba", engine_kwargs={"parallel": self.parallel}
698+
)
683699

684-
def time_series_cython(self):
700+
def time_series_cython(self, parallel):
685701
def function(values):
686702
total = 0
687703
for i, value in enumerate(values):
@@ -693,7 +709,7 @@ def function(values):
693709

694710
self.grouper[1].agg(function, engine="cython")
695711

696-
def time_dataframe_numba(self):
712+
def time_dataframe_numba(self, parallel):
697713
def function(values, index):
698714
total = 0
699715
for i, value in enumerate(values):
@@ -703,9 +719,11 @@ def function(values, index):
703719
total += value * 2
704720
return total
705721

706-
self.grouper.agg(function, engine="numba")
722+
self.grouper.agg(
723+
function, engine="numba", engine_kwargs={"parallel": self.parallel}
724+
)
707725

708-
def time_dataframe_cython(self):
726+
def time_dataframe_cython(self, parallel):
709727
def function(values):
710728
total = 0
711729
for i, value in enumerate(values):

ci/build39.sh

+1-8
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,9 @@
33

44
sudo apt-get install build-essential gcc xvfb
55
pip install --no-deps -U pip wheel setuptools
6-
pip install python-dateutil pytz pytest pytest-xdist hypothesis
6+
pip install numpy python-dateutil pytz pytest pytest-xdist hypothesis
77
pip install cython --pre # https://github.com/cython/cython/issues/3395
88

9-
git clone https://github.com/numpy/numpy
10-
cd numpy
11-
python setup.py build_ext --inplace
12-
python setup.py install
13-
cd ..
14-
rm -rf numpy
15-
169
python setup.py build_ext -inplace
1710
python -m pip install --no-build-isolation -e .
1811

ci/code_checks.sh

+31-4
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,22 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
116116
fi
117117
RET=$(($RET + $?)) ; echo $MSG "DONE"
118118

119+
MSG='Check for import of private attributes across modules' ; echo $MSG
120+
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
121+
$BASE_DIR/scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module" --included-file-extensions="py" --excluded-file-paths=pandas/tests,asv_bench/,pandas/_vendored --format="##[error]{source_path}:{line_number}:{msg}" pandas/
122+
else
123+
$BASE_DIR/scripts/validate_unwanted_patterns.py --validation-type="private_import_across_module" --included-file-extensions="py" --excluded-file-paths=pandas/tests,asv_bench/,pandas/_vendored pandas/
124+
fi
125+
RET=$(($RET + $?)) ; echo $MSG "DONE"
126+
127+
MSG='Check for use of private functions across modules' ; echo $MSG
128+
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
129+
$BASE_DIR/scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module" --included-file-extensions="py" --excluded-file-paths=pandas/tests,asv_bench/,pandas/_vendored,doc/ --format="##[error]{source_path}:{line_number}:{msg}" pandas/
130+
else
131+
$BASE_DIR/scripts/validate_unwanted_patterns.py --validation-type="private_function_across_module" --included-file-extensions="py" --excluded-file-paths=pandas/tests,asv_bench/,pandas/_vendored,doc/ pandas/
132+
fi
133+
RET=$(($RET + $?)) ; echo $MSG "DONE"
134+
119135
echo "isort --version-number"
120136
isort --version-number
121137

@@ -179,6 +195,10 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
179195
invgrep -R --include="*.py" -E "super\(\w*, (self|cls)\)" pandas
180196
RET=$(($RET + $?)) ; echo $MSG "DONE"
181197

198+
MSG='Check for use of builtin filter function' ; echo $MSG
199+
invgrep -R --include="*.py" -P '(?<!def)[\(\s]filter\(' pandas
200+
RET=$(($RET + $?)) ; echo $MSG "DONE"
201+
182202
# Check for the following code in testing: `np.testing` and `np.array_equal`
183203
MSG='Check for invalid testing' ; echo $MSG
184204
invgrep -r -E --include '*.py' --exclude testing.py '(numpy|np)(\.testing|\.array_equal)' pandas/tests/
@@ -226,15 +246,22 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
226246
invgrep -R --include=*.{py,pyx} '!r}' pandas
227247
RET=$(($RET + $?)) ; echo $MSG "DONE"
228248

249+
# -------------------------------------------------------------------------
250+
# Type annotations
251+
229252
MSG='Check for use of comment-based annotation syntax' ; echo $MSG
230253
invgrep -R --include="*.py" -P '# type: (?!ignore)' pandas
231254
RET=$(($RET + $?)) ; echo $MSG "DONE"
232255

233-
# https://github.com/python/mypy/issues/7384
234-
# MSG='Check for missing error codes with # type: ignore' ; echo $MSG
235-
# invgrep -R --include="*.py" -P '# type: ignore(?!\[)' pandas
236-
# RET=$(($RET + $?)) ; echo $MSG "DONE"
256+
MSG='Check for missing error codes with # type: ignore' ; echo $MSG
257+
invgrep -R --include="*.py" -P '# type:\s?ignore(?!\[)' pandas
258+
RET=$(($RET + $?)) ; echo $MSG "DONE"
259+
260+
MSG='Check for use of Union[Series, DataFrame] instead of FrameOrSeriesUnion alias' ; echo $MSG
261+
invgrep -R --include="*.py" --exclude=_typing.py -E 'Union\[.*(Series.*DataFrame|DataFrame.*Series).*\]' pandas
262+
RET=$(($RET + $?)) ; echo $MSG "DONE"
237263

264+
# -------------------------------------------------------------------------
238265
MSG='Check for use of foo.__class__ instead of type(foo)' ; echo $MSG
239266
invgrep -R --include=*.{py,pyx} '\.__class__' pandas
240267
RET=$(($RET + $?)) ; echo $MSG "DONE"

ci/deps/azure-37-locale_slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- lxml
1919
- matplotlib=3.0.0
2020
- numpy=1.16.*
21-
- openpyxl=2.5.7
21+
- openpyxl=2.6.0
2222
- python-dateutil
2323
- python-blosc
2424
- pytz=2017.3

ci/deps/azure-37-minimum_versions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- numba=0.46.0
2020
- numexpr=2.6.8
2121
- numpy=1.16.5
22-
- openpyxl=2.5.7
22+
- openpyxl=2.6.0
2323
- pytables=3.4.4
2424
- python-dateutil=2.7.3
2525
- pytz=2017.3

ci/deps/azure-windows-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
# tools
99
- cython>=0.29.16
1010
- pytest>=5.0.1
11-
- pytest-xdist>=1.21,<2.0.0 # GH 35737
11+
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines
1414

ci/deps/azure-windows-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
# tools
99
- cython>=0.29.16
1010
- pytest>=5.0.1
11-
- pytest-xdist>=1.21,<2.0.0 # GH 35737
11+
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines
1414

doc/source/development/contributing.rst

+1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ You will need `Build Tools for Visual Studio 2017
204204
You DO NOT need to install Visual Studio 2019.
205205
You only need "Build Tools for Visual Studio 2019" found by
206206
scrolling down to "All downloads" -> "Tools for Visual Studio 2019".
207+
In the installer, select the "C++ build tools" workload.
207208

208209
**Mac OS**
209210

doc/source/development/contributing_docstring.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ The next example gives an idea of what a docstring looks like:
3232
Parameters
3333
----------
3434
num1 : int
35-
First number to add
35+
First number to add.
3636
num2 : int
37-
Second number to add
37+
Second number to add.
3838
3939
Returns
4040
-------
4141
int
42-
The sum of `num1` and `num2`
42+
The sum of `num1` and `num2`.
4343
4444
See Also
4545
--------
46-
subtract : Subtract one integer from another
46+
subtract : Subtract one integer from another.
4747
4848
Examples
4949
--------
@@ -998,4 +998,4 @@ mapping function names to docstrings. Wherever possible, we prefer using
998998

999999
See ``pandas.core.generic.NDFrame.fillna`` for an example template, and
10001000
``pandas.core.series.Series.fillna`` and ``pandas.core.generic.frame.fillna``
1001-
for the filled versions.
1001+
for the filled versions.

doc/source/development/extending.rst

-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ applies only to certain dtypes.
7373
Extension types
7474
---------------
7575

76-
.. versionadded:: 0.23.0
77-
7876
.. warning::
7977

8078
The :class:`pandas.api.extensions.ExtensionDtype` and :class:`pandas.api.extensions.ExtensionArray` APIs are new and

doc/source/getting_started/install.rst

+1-3
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ html5lib 1.0.1 HTML parser for read_html (see :ref
274274
lxml 4.3.0 HTML parser for read_html (see :ref:`note <optional_html>`)
275275
matplotlib 2.2.3 Visualization
276276
numba 0.46.0 Alternative execution engine for rolling operations
277-
openpyxl 2.5.7 Reading / writing for xlsx files
277+
openpyxl 2.6.0 Reading / writing for xlsx files
278278
pandas-gbq 0.12.0 Google Big Query access
279279
psycopg2 2.7 PostgreSQL engine for sqlalchemy
280280
pyarrow 0.15.0 Parquet, ORC, and feather reading / writing
@@ -301,8 +301,6 @@ Optional dependencies for parsing HTML
301301
One of the following combinations of libraries is needed to use the
302302
top-level :func:`~pandas.read_html` function:
303303

304-
.. versionchanged:: 0.23.0
305-
306304
* `BeautifulSoup4`_ and `html5lib`_
307305
* `BeautifulSoup4`_ and `lxml`_
308306
* `BeautifulSoup4`_ and `html5lib`_ and `lxml`_

0 commit comments

Comments
 (0)