Skip to content

Commit 237dde7

Browse files
authored
Merge branch 'main' into revising-doc-string-for-_agg_template-(GH-pandas-dev#47974)
2 parents e490249 + bf5ee72 commit 237dde7

File tree

201 files changed

+2931
-1535
lines changed

Some content is hidden

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

201 files changed

+2931
-1535
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717

1818
jobs:
1919
pytest:
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-22.04
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v3

.github/workflows/assign.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
issues: write
1313
pull-requests: write
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- if: github.event.comment.body == 'take'
1717
run: |

.github/workflows/asv-bot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
name: "Run benchmarks"
2222
# TODO: Support more benchmarking options later, against different branches, against self, etc
2323
if: startsWith(github.event.comment.body, '@github-actions benchmark')
24-
runs-on: ubuntu-latest
24+
runs-on: ubuntu-22.04
2525
defaults:
2626
run:
2727
shell: bash -el {0}

.github/workflows/autoupdate-pre-commit-config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
pull-requests: write # for technote-space/create-pr-action to create a PR
1616
if: github.repository_owner == 'pandas-dev'
1717
name: Autoupdate pre-commit config
18-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-22.04
1919
steps:
2020
- name: Set up Python
2121
uses: actions/setup-python@v4

.github/workflows/code-checks.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020
jobs:
2121
pre_commit:
2222
name: pre-commit
23-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-22.04
2424
concurrency:
2525
# https://github.community/t/concurrecy-not-work-for-push/183068/7
2626
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pre-commit
@@ -39,9 +39,9 @@ jobs:
3939
with:
4040
extra_args: --verbose --all-files
4141

42-
docstring_typing_pylint:
43-
name: Docstring validation, typing, and pylint
44-
runs-on: ubuntu-latest
42+
docstring_typing_manual_hooks:
43+
name: Docstring validation, typing, and other manual pre-commit hooks
44+
runs-on: ubuntu-22.04
4545
defaults:
4646
run:
4747
shell: bash -el {0}
@@ -104,7 +104,7 @@ jobs:
104104

105105
asv-benchmarks:
106106
name: ASV Benchmarks
107-
runs-on: ubuntu-latest
107+
runs-on: ubuntu-22.04
108108
defaults:
109109
run:
110110
shell: bash -el {0}
@@ -135,7 +135,7 @@ jobs:
135135
136136
build_docker_dev_environment:
137137
name: Build Docker Dev Environment
138-
runs-on: ubuntu-latest
138+
runs-on: ubuntu-22.04
139139
defaults:
140140
run:
141141
shell: bash -el {0}
@@ -162,7 +162,7 @@ jobs:
162162

163163
requirements-dev-text-installable:
164164
name: Test install requirements-dev.txt
165-
runs-on: ubuntu-latest
165+
runs-on: ubuntu-22.04
166166

167167
concurrency:
168168
# https://github.community/t/concurrecy-not-work-for-push/183068/7

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010

1111
jobs:
1212
analyze:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414
permissions:
1515
actions: read
1616
contents: read

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ permissions:
2222
jobs:
2323
web_and_docs:
2424
name: Doc Build and Upload
25-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-22.04
2626

2727
concurrency:
2828
# https://github.community/t/concurrecy-not-work-for-push/183068/7

.github/workflows/package-checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717
jobs:
1818
pip:
1919
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-22.04
2121
strategy:
2222
matrix:
2323
extra: ["test", "performance", "timezone", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"]

.github/workflows/python-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
fail-fast: false
5151
matrix:
52-
os: [ubuntu-latest, macOS-latest, windows-latest]
52+
os: [ubuntu-22.04, macOS-latest, windows-latest]
5353

5454
name: actions-311-dev
5555
timeout-minutes: 120

.github/workflows/scorecards.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ permissions: read-all
1313
jobs:
1414
analysis:
1515
name: Scorecards analysis
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-22.04
17+
continue-on-error: true
1718
permissions:
1819
# Needed to upload the results to code-scanning dashboard.
1920
security-events: write

.github/workflows/sdist.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919
jobs:
2020
build:
2121
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
22-
runs-on: ubuntu-latest
22+
runs-on: ubuntu-22.04
2323
timeout-minutes: 60
2424
defaults:
2525
run:

.github/workflows/stale-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
stale:
1212
permissions:
1313
pull-requests: write
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- uses: actions/stale@v4
1717
with:

.github/workflows/ubuntu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020

2121
jobs:
2222
pytest:
23-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-22.04
2424
defaults:
2525
run:
2626
shell: bash -el {0}

.github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
(github.event_name == 'pull_request' &&
128128
contains(github.event.pull_request.labels.*.name, 'Build')) ||
129129
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
130-
runs-on: ubuntu-latest
130+
runs-on: ubuntu-22.04
131131
env:
132132
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
133133
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}

.pre-commit-config.yaml

+25-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
minimum_pre_commit_version: 2.15.0
22
exclude: ^LICENSES/|\.(html|csv|svg)$
3-
# reserve "manual" for mypy and pyright
4-
default_stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
3+
# reserve "manual" for relatively slow hooks which we still want to run in CI
4+
default_stages: [
5+
commit,
6+
merge-commit,
7+
push,
8+
prepare-commit-msg,
9+
commit-msg,
10+
post-checkout,
11+
post-commit,
12+
post-merge,
13+
post-rewrite
14+
]
515
ci:
616
autofix_prs: false
717
repos:
@@ -34,9 +44,11 @@ repos:
3444
- id: debug-statements
3545
- id: end-of-file-fixer
3646
exclude: \.txt$
37-
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
47+
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg,
48+
post-checkout, post-commit, post-merge, post-rewrite]
3849
- id: trailing-whitespace
39-
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
50+
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg,
51+
post-checkout, post-commit, post-merge, post-rewrite]
4052
- repo: https://github.com/cpplint/cpplint
4153
rev: 1.6.1
4254
hooks:
@@ -46,7 +58,13 @@ repos:
4658
# this particular codebase (e.g. src/headers, src/klib). However,
4759
# we can lint all header files since they aren't "generated" like C files are.
4860
exclude: ^pandas/_libs/src/(klib|headers)/
49-
args: [--quiet, '--extensions=c,h', '--headers=h', --recursive, '--filter=-readability/casting,-runtime/int,-build/include_subdir']
61+
args: [
62+
--quiet,
63+
'--extensions=c,h',
64+
'--headers=h',
65+
--recursive,
66+
'--filter=-readability/casting,-runtime/int,-build/include_subdir'
67+
]
5068
- repo: https://github.com/PyCQA/flake8
5169
rev: 6.0.0
5270
hooks:
@@ -107,6 +125,7 @@ repos:
107125
hooks:
108126
- id: yesqa
109127
additional_dependencies: *flake8_dependencies
128+
stages: [manual]
110129
- repo: local
111130
hooks:
112131
# NOTE: we make `black` a local hook because if it's installed from
@@ -214,7 +233,6 @@ repos:
214233
exclude: ^pandas/tests/extension/base/base\.py
215234
- id: pip-to-conda
216235
name: Generate pip dependency from conda
217-
description: This hook checks if the conda environment.yml and requirements-dev.txt are equal
218236
language: python
219237
entry: python scripts/generate_pip_deps_from_conda.py
220238
files: ^(environment.yml|requirements-dev.txt)$
@@ -311,6 +329,7 @@ repos:
311329
files: ^pandas
312330
exclude: ^(pandas/tests|pandas/_version.py|pandas/io/clipboard)
313331
language: python
332+
stages: [manual]
314333
additional_dependencies:
315334
- autotyping==22.9.0
316335
- libcst==0.4.7

asv_bench/benchmarks/indexing.py

+6
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ def setup(self):
139139
def time_loc(self):
140140
self.df.loc[self.idx_scalar, self.col_scalar]
141141

142+
def time_at(self):
143+
self.df.at[self.idx_scalar, self.col_scalar]
144+
145+
def time_at_setitem(self):
146+
self.df.at[self.idx_scalar, self.col_scalar] = 0.0
147+
142148
def time_getitem_scalar(self):
143149
self.df[self.col_scalar][self.idx_scalar]
144150

asv_bench/benchmarks/io/excel.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ def setup(self, engine):
4242
def time_write_excel(self, engine):
4343
bio = BytesIO()
4444
bio.seek(0)
45-
writer = ExcelWriter(bio, engine=engine)
46-
self.df.to_excel(writer, sheet_name="Sheet1")
47-
writer.save()
45+
with ExcelWriter(bio, engine=engine) as writer:
46+
self.df.to_excel(writer, sheet_name="Sheet1")
4847

4948

5049
class WriteExcelStyled:
@@ -57,13 +56,12 @@ def setup(self, engine):
5756
def time_write_excel_style(self, engine):
5857
bio = BytesIO()
5958
bio.seek(0)
60-
writer = ExcelWriter(bio, engine=engine)
61-
df_style = self.df.style
62-
df_style.applymap(lambda x: "border: red 1px solid;")
63-
df_style.applymap(lambda x: "color: blue")
64-
df_style.applymap(lambda x: "border-color: green black", subset=["float1"])
65-
df_style.to_excel(writer, sheet_name="Sheet1")
66-
writer.save()
59+
with ExcelWriter(bio, engine=engine) as writer:
60+
df_style = self.df.style
61+
df_style.applymap(lambda x: "border: red 1px solid;")
62+
df_style.applymap(lambda x: "color: blue")
63+
df_style.applymap(lambda x: "border-color: green black", subset=["float1"])
64+
df_style.to_excel(writer, sheet_name="Sheet1")
6765

6866

6967
class ReadExcel:

asv_bench/benchmarks/series_methods.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class Fillna:
8585
[
8686
"datetime64[ns]",
8787
"float64",
88+
"Float64",
8889
"Int64",
8990
"int64[pyarrow]",
9091
"string",
@@ -99,7 +100,7 @@ def setup(self, dtype, method):
99100
if dtype == "datetime64[ns]":
100101
data = date_range("2000-01-01", freq="S", periods=N)
101102
na_value = NaT
102-
elif dtype == "float64":
103+
elif dtype in ("float64", "Float64"):
103104
data = np.random.randn(N)
104105
na_value = np.nan
105106
elif dtype in ("Int64", "int64[pyarrow]"):

ci/deps/actions-310.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies:
3333
- gcsfs
3434
- jinja2
3535
- lxml
36-
- matplotlib
36+
- matplotlib>=3.6.1
3737
- numba
3838
- numexpr
3939
- openpyxl

ci/deps/actions-38-downstream_compat.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,11 @@ dependencies:
3434
- gcsfs
3535
- jinja2
3636
- lxml
37-
- matplotlib
37+
- matplotlib>=3.6.1
3838
- numba
3939
- numexpr
4040
- openpyxl
4141
- odfpy
42-
- pandas-gbq
4342
- psycopg2
4443
- pyarrow<10
4544
- pymysql
@@ -68,5 +67,6 @@ dependencies:
6867
- statsmodels
6968
- coverage
7069
- pandas-datareader
70+
- pandas-gbq
7171
- pyyaml
7272
- py

ci/deps/actions-38.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies:
3333
- gcsfs
3434
- jinja2
3535
- lxml
36-
- matplotlib
36+
- matplotlib>=3.6.1
3737
- numba
3838
- numexpr
3939
- openpyxl

ci/deps/actions-39.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies:
3333
- gcsfs
3434
- jinja2
3535
- lxml
36-
- matplotlib
36+
- matplotlib>=3.6.1
3737
- numba
3838
- numexpr
3939
- openpyxl

ci/deps/circle-38-arm64.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies:
3333
- gcsfs
3434
- jinja2
3535
- lxml
36-
- matplotlib
36+
- matplotlib>=3.6.1
3737
- numba
3838
- numexpr
3939
- openpyxl

doc/source/development/contributing_environment.rst

+9-21
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,17 @@ These packages will automatically be installed by using the ``pandas``
3636

3737
**Windows**
3838

39-
You will need `Build Tools for Visual Studio 2019
40-
<https://visualstudio.microsoft.com/downloads/>`_.
39+
You will need `Build Tools for Visual Studio 2022
40+
<https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022>`_.
4141

42-
.. warning::
43-
You DO NOT need to install Visual Studio 2019.
44-
You only need "Build Tools for Visual Studio 2019" found by
45-
scrolling down to "All downloads" -> "Tools for Visual Studio 2019".
46-
In the installer, select the "C++ build tools" workload.
42+
.. note::
43+
You DO NOT need to install Visual Studio 2022.
44+
You only need "Build Tools for Visual Studio 2022" found by
45+
scrolling down to "All downloads" -> "Tools for Visual Studio".
46+
In the installer, select the "Desktop development with C++" Workloads.
4747

48-
You can install the necessary components on the commandline using
49-
`vs_buildtools.exe <https://download.visualstudio.microsoft.com/download/pr/9a26f37e-6001-429b-a5db-c5455b93953c/460d80ab276046de2455a4115cc4e2f1e6529c9e6cb99501844ecafd16c619c4/vs_BuildTools.exe>`_:
50-
51-
.. code::
52-
53-
vs_buildtools.exe --quiet --wait --norestart --nocache ^
54-
--installPath C:\BuildTools ^
55-
--add "Microsoft.VisualStudio.Workload.VCTools;includeRecommended" ^
56-
--add Microsoft.VisualStudio.Component.VC.v141 ^
57-
--add Microsoft.VisualStudio.Component.VC.v141.x86.x64 ^
58-
--add Microsoft.VisualStudio.Component.Windows10SDK.17763
59-
60-
To setup the right paths on the commandline, call
61-
``"C:\BuildTools\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.16 10.0.17763.0``.
48+
Alternatively, you can install the necessary components on the commandline using
49+
`vs_BuildTools.exe <https://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?source=recommendations&view=vs-2022>`_
6250

6351
**macOS**
6452

0 commit comments

Comments
 (0)