Skip to content

Commit 55054c3

Browse files
authored
Merge branch 'main' into GH24845v2
2 parents 80c8c20 + c70f9b9 commit 55054c3

File tree

300 files changed

+5144
-1905
lines changed

Some content is hidden

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

300 files changed

+5144
-1905
lines changed

.github/workflows/codeql.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CodeQL
2+
on:
3+
schedule:
4+
# every day at midnight
5+
- cron: "0 0 * * *"
6+
7+
concurrency:
8+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
analyze:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language:
23+
- python
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- uses: github/codeql-action/init@v2
28+
with:
29+
languages: ${{ matrix.language }}
30+
- uses: github/codeql-action/autobuild@v2
31+
- uses: github/codeql-action/analyze@v2

.github/workflows/sdist.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ jobs:
7979
run: |
8080
case "${{matrix.python-version}}" in
8181
3.8)
82-
pip install numpy==1.19.5 ;;
82+
pip install numpy==1.20.3 ;;
8383
3.9)
84-
pip install numpy==1.19.5 ;;
84+
pip install numpy==1.20.3 ;;
8585
3.10)
8686
pip install numpy==1.21.2 ;;
8787
esac

.pre-commit-config.yaml

+21-12
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: absolufy-imports
1212
files: ^pandas/
1313
- repo: https://github.com/jendrikseipp/vulture
14-
rev: 'v2.4'
14+
rev: 'v2.5'
1515
hooks:
1616
- id: vulture
1717
entry: python scripts/run_vulture.py
@@ -46,20 +46,19 @@ repos:
4646
exclude: ^pandas/_libs/src/(klib|headers)/
4747
args: [--quiet, '--extensions=c,h', '--headers=h', --recursive, '--filter=-readability/casting,-runtime/int,-build/include_subdir']
4848
- repo: https://github.com/PyCQA/flake8
49-
rev: 4.0.1
49+
rev: 5.0.4
5050
hooks:
5151
- id: flake8
5252
additional_dependencies: &flake8_dependencies
53-
- flake8==4.0.1
54-
- flake8-comprehensions==3.7.0
55-
- flake8-bugbear==21.3.2
53+
- flake8==5.0.4
54+
- flake8-bugbear==22.7.1
5655
- pandas-dev-flaker==0.5.0
5756
- repo: https://github.com/PyCQA/isort
5857
rev: 5.10.1
5958
hooks:
6059
- id: isort
6160
- repo: https://github.com/asottile/pyupgrade
62-
rev: v2.34.0
61+
rev: v2.37.3
6362
hooks:
6463
- id: pyupgrade
6564
args: [--py38-plus]
@@ -85,32 +84,42 @@ repos:
8584
- repo: local
8685
hooks:
8786
- id: pyright
87+
# note: assumes python env is setup and activated
8888
name: pyright
8989
entry: pyright
90-
# note: assumes python env is setup and activated
9190
language: node
9291
pass_filenames: false
9392
types: [python]
9493
stages: [manual]
9594
additional_dependencies: &pyright_dependencies
96-
95+
9796
- id: pyright_reportGeneralTypeIssues
97+
# note: assumes python env is setup and activated
9898
name: pyright reportGeneralTypeIssues
9999
entry: pyright --skipunannotated -p pyright_reportGeneralTypeIssues.json
100-
# note: assumes python env is setup and activated
101100
language: node
102101
pass_filenames: false
103102
types: [python]
104103
stages: [manual]
105104
additional_dependencies: *pyright_dependencies
106105
- id: mypy
106+
# note: assumes python env is setup and activated
107107
name: mypy
108108
entry: mypy
109-
# note: assumes python env is setup and activated
110109
language: system
111110
pass_filenames: false
112111
types: [python]
113112
stages: [manual]
113+
- id: stubtest
114+
# note: assumes python env is setup and activated
115+
# note: requires pandas dev to be installed
116+
name: mypy (stubtest)
117+
entry: python
118+
language: system
119+
pass_filenames: false
120+
types: [pyi]
121+
args: [scripts/run_stubtest.py]
122+
stages: [manual]
114123
- id: flake8-rst
115124
name: flake8-rst
116125
description: Run flake8 on code snippets in docstrings or RST files
@@ -229,8 +238,8 @@ repos:
229238
types: [pyi]
230239
language: python
231240
additional_dependencies:
232-
- flake8==4.0.1
233-
- flake8-pyi==22.5.1
241+
- flake8==5.0.4
242+
- flake8-pyi==22.8.1
234243
- id: future-annotations
235244
name: import annotations from __future__
236245
entry: 'from __future__ import annotations'

asv_bench/asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
// followed by the pip installed packages).
4343
"matrix": {
4444
"numpy": [],
45-
"Cython": ["0.29.30"],
45+
"Cython": ["0.29.32"],
4646
"matplotlib": [],
4747
"sqlalchemy": [],
4848
"scipy": [],

ci/code_checks.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ fi
7878
### DOCSTRINGS ###
7979
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8080

81-
MSG='Validate docstrings (EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT04, RT05, SA02, SA03, SA04, SS01, SS02, SS03, SS04, SS05)' ; echo $MSG
82-
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05
81+
MSG='Validate docstrings (EX04, GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, PR03, PR04, PR05, PR06, PR08, PR09, PR10, RT01, RT04, RT05, SA02, SA03, SA04, SS01, SS02, SS03, SS04, SS05, SS06)' ; echo $MSG
82+
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX04,GL01,GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,PR03,PR04,PR05,PR06,PR08,PR09,PR10,RT01,RT04,RT05,SA02,SA03,SA04,SS01,SS02,SS03,SS04,SS05,SS06
8383
RET=$(($RET + $?)) ; echo $MSG "DONE"
8484

8585
fi

ci/deps/actions-310-numpydev.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ dependencies:
1616
- pytz
1717
- pip
1818
- pip:
19-
#- cython # TODO: don't install from master after Cython 3.0.0a11 is released
20-
- "git+https://github.com/cython/cython.git@master"
19+
- "cython"
2120
- "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple"
2221
- "--pre"
2322
- "numpy"

ci/deps/actions-310.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.10
66

77
# test dependencies
8-
- cython=0.29.30
8+
- cython>=0.29.32
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31
@@ -47,6 +47,7 @@ dependencies:
4747
- scipy
4848
- sqlalchemy
4949
- tabulate
50+
- tzdata>=2022a
5051
- xarray
5152
- xlrd
5253
- xlsxwriter

ci/deps/actions-38-downstream_compat.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.8
77

88
# test dependencies
9-
- cython=0.29.30
9+
- cython>=0.29.32
1010
- pytest>=6.0
1111
- pytest-cov
1212
- pytest-xdist>=1.31

ci/deps/actions-38-minimum_versions.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77
- python=3.8.0
88

99
# test dependencies
10-
- cython=0.29.30
10+
- cython>=0.29.32
1111
- pytest>=6.0
1212
- pytest-cov
1313
- pytest-xdist>=1.31
@@ -17,7 +17,7 @@ dependencies:
1717

1818
# required dependencies
1919
- python-dateutil=2.8.1
20-
- numpy=1.19.5
20+
- numpy=1.20.3
2121
- pytz=2020.1
2222

2323
# optional dependencies
@@ -49,6 +49,7 @@ dependencies:
4949
- scipy=1.7.1
5050
- sqlalchemy=1.4.16
5151
- tabulate=0.8.9
52+
- tzdata=2022a
5253
- xarray=0.19.0
5354
- xlrd=2.0.1
5455
- xlsxwriter=1.4.3

ci/deps/actions-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.8
66

77
# test dependencies
8-
- cython=0.29.30
8+
- cython>=0.29.32
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31

ci/deps/actions-39.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.9
66

77
# test dependencies
8-
- cython=0.29.30
8+
- cython>=0.29.32
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31
@@ -47,6 +47,7 @@ dependencies:
4747
- scipy
4848
- sqlalchemy
4949
- tabulate
50+
- tzdata>=2022a
5051
- xarray
5152
- xlrd
5253
- xlsxwriter

ci/deps/actions-pypy-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
- python=3.8[build=*_pypy] # TODO: use this once pypy3.8 is available
99

1010
# tools
11-
- cython>=0.29.30
11+
- cython>=0.29.32
1212
- pytest>=6.0
1313
- pytest-cov
1414
- pytest-asyncio

ci/deps/circle-38-arm64.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.8
66

77
# test dependencies
8-
- cython=0.29.30
8+
- cython>=0.29.32
99
- pytest>=6.0
1010
- pytest-cov
1111
- pytest-xdist>=1.31

doc/source/conf.py

+24-12
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,25 @@
5050
# sphinxext.
5151

5252
extensions = [
53-
"sphinx.ext.autodoc",
54-
"sphinx.ext.autosummary",
55-
"sphinx.ext.doctest",
56-
"sphinx.ext.extlinks",
57-
"sphinx.ext.todo",
58-
"numpydoc", # handle NumPy documentation formatted docstrings
53+
"contributors", # custom pandas extension
5954
"IPython.sphinxext.ipython_directive",
6055
"IPython.sphinxext.ipython_console_highlighting",
6156
"matplotlib.sphinxext.plot_directive",
62-
"sphinx.ext.intersphinx",
57+
"numpydoc",
58+
"sphinx_copybutton",
59+
"sphinx_panels",
60+
"sphinx_toggleprompt",
61+
"sphinx.ext.autodoc",
62+
"sphinx.ext.autosummary",
6363
"sphinx.ext.coverage",
64-
"sphinx.ext.mathjax",
64+
"sphinx.ext.doctest",
65+
"sphinx.ext.extlinks",
6566
"sphinx.ext.ifconfig",
67+
"sphinx.ext.intersphinx",
6668
"sphinx.ext.linkcode",
69+
"sphinx.ext.mathjax",
70+
"sphinx.ext.todo",
6771
"nbsphinx",
68-
"sphinx_panels",
69-
"contributors", # custom pandas extension
7072
]
7173

7274
exclude_patterns = [
@@ -144,6 +146,9 @@
144146
# already loads it
145147
panels_add_bootstrap_css = False
146148

149+
# https://sphinx-toggleprompt.readthedocs.io/en/stable/#offset
150+
toggleprompt_offset_right = 35
151+
147152
# Add any paths that contain templates here, relative to this directory.
148153
templates_path = ["../_templates"]
149154

@@ -453,7 +458,6 @@
453458
# extlinks alias
454459
extlinks = {
455460
"issue": ("https://github.com/pandas-dev/pandas/issues/%s", "GH"),
456-
"wiki": ("https://github.com/pandas-dev/pandas/wiki/%s", "wiki "),
457461
}
458462

459463

@@ -649,12 +653,20 @@ def linkcode_resolve(domain, info):
649653
try:
650654
fn = inspect.getsourcefile(inspect.unwrap(obj))
651655
except TypeError:
652-
fn = None
656+
try: # property
657+
fn = inspect.getsourcefile(inspect.unwrap(obj.fget))
658+
except (AttributeError, TypeError):
659+
fn = None
653660
if not fn:
654661
return None
655662

656663
try:
657664
source, lineno = inspect.getsourcelines(obj)
665+
except TypeError:
666+
try: # property
667+
source, lineno = inspect.getsourcelines(obj.fget)
668+
except (AttributeError, TypeError):
669+
lineno = None
658670
except OSError:
659671
lineno = None
660672

doc/source/ecosystem.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ A good implementation for Python users is `has2k1/plotnine <https://github.com/h
161161
`IPython Vega <https://github.com/vega/ipyvega>`__ leverages `Vega
162162
<https://github.com/vega/vega>`__ to create plots within Jupyter Notebook.
163163

164-
`Plotly <https://poltly.com/python>`__
164+
`Plotly <https://plotly.com/python>`__
165165
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166166

167-
`Plotly’s <https://poltly.com/>`__ `Python API <https://poltly.com/python/>`__ enables interactive figures and web shareability. Maps, 2D, 3D, and live-streaming graphs are rendered with WebGL and `D3.js <https://d3js.org/>`__. The library supports plotting directly from a pandas DataFrame and cloud-based collaboration. Users of `matplotlib, ggplot for Python, and Seaborn <https://poltly.com/python/matplotlib-to-plotly-tutorial/>`__ can convert figures into interactive web-based plots. Plots can be drawn in `IPython Notebooks <https://plotly.com/ipython-notebooks/>`__ , edited with R or MATLAB, modified in a GUI, or embedded in apps and dashboards. Plotly is free for unlimited sharing, and has `offline <https://poltly.com/python/offline/>`__, or `on-premise <https://poltly.com/product/enterprise/>`__ accounts for private use.
167+
`Plotly’s <https://plotly.com/>`__ `Python API <https://plotly.com/python/>`__ enables interactive figures and web shareability. Maps, 2D, 3D, and live-streaming graphs are rendered with WebGL and `D3.js <https://d3js.org/>`__. The library supports plotting directly from a pandas DataFrame and cloud-based collaboration. Users of `matplotlib, ggplot for Python, and Seaborn <https://plotly.com/python/matplotlib-to-plotly-tutorial/>`__ can convert figures into interactive web-based plots. Plots can be drawn in `IPython Notebooks <https://plotly.com/ipython-notebooks/>`__ , edited with R or MATLAB, modified in a GUI, or embedded in apps and dashboards. Plotly is free for unlimited sharing, and has `offline <https://plotly.com/python/offline/>`__, or `on-premise <https://plotly.com/product/enterprise/>`__ accounts for private use.
168168

169169
`Lux <https://github.com/lux-org/lux>`__
170170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -591,12 +591,12 @@ Library Accessor Classes Description
591591
Development tools
592592
-----------------
593593

594-
`pandas-stubs <https://github.com/VirtusLab/pandas-stubs>`__
595-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
594+
`pandas-stubs <https://github.com/pandas-dev/pandas-stubs>`__
595+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
596596

597597
While pandas repository is partially typed, the package itself doesn't expose this information for external use.
598598
Install pandas-stubs to enable basic type coverage of pandas API.
599599

600600
Learn more by reading through :issue:`14468`, :issue:`26766`, :issue:`28142`.
601601

602-
See installation and usage instructions on the `github page <https://github.com/VirtusLab/pandas-stubs>`__.
602+
See installation and usage instructions on the `github page <https://github.com/pandas-dev/pandas-stubs>`__.

doc/source/getting_started/install.rst

+18-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Dependencies
235235
================================================================ ==========================
236236
Package Minimum supported version
237237
================================================================ ==========================
238-
`NumPy <https://numpy.org>`__ 1.19.5
238+
`NumPy <https://numpy.org>`__ 1.20.3
239239
`python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ 2.8.1
240240
`pytz <https://pypi.org/project/pytz/>`__ 2020.1
241241
================================================================ ==========================
@@ -270,6 +270,23 @@ For example, :func:`pandas.read_hdf` requires the ``pytables`` package, while
270270
optional dependency is not installed, pandas will raise an ``ImportError`` when
271271
the method requiring that dependency is called.
272272

273+
Timezones
274+
^^^^^^^^^
275+
276+
========================= ========================= =============================================================
277+
Dependency Minimum Version Notes
278+
========================= ========================= =============================================================
279+
tzdata 2022.1(pypi)/ Allows the use of ``zoneinfo`` timezones with pandas.
280+
2022a(for system tzdata) **Note**: You only need to install the pypi package if your
281+
system does not already provide the IANA tz database.
282+
However, the minimum tzdata version still applies, even if it
283+
is not enforced through an error.
284+
285+
If you would like to keep your system tzdata version updated,
286+
it is recommended to use the ``tzdata`` package from
287+
conda-forge.
288+
========================= ========================= =============================================================
289+
273290
Visualization
274291
^^^^^^^^^^^^^
275292

0 commit comments

Comments
 (0)