Skip to content

Commit 30cf4c1

Browse files
Merge branch 'change-closed-docs' of github.com:SebastianOuslis/pandas into change-closed-docs
2 parents a89e745 + 41bf4be commit 30cf4c1

File tree

95 files changed

+227
-352
lines changed

Some content is hidden

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

95 files changed

+227
-352
lines changed

.github/workflows/unit-tests.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107

108108
services:
109109
mysql:
110-
image: mysql:8
110+
image: mysql:9
111111
env:
112112
MYSQL_ALLOW_EMPTY_PASSWORD: yes
113113
MYSQL_DATABASE: pandas
@@ -120,7 +120,7 @@ jobs:
120120
- 3306:3306
121121

122122
postgres:
123-
image: postgres:16
123+
image: postgres:17
124124
env:
125125
PGUSER: postgres
126126
POSTGRES_USER: postgres
@@ -135,7 +135,7 @@ jobs:
135135
- 5432:5432
136136

137137
moto:
138-
image: motoserver/moto:5.0.0
138+
image: motoserver/moto:5.0.27
139139
env:
140140
AWS_ACCESS_KEY_ID: foobar_key
141141
AWS_SECRET_ACCESS_KEY: foobar_secret
@@ -242,15 +242,14 @@ jobs:
242242
- name: Build environment and Run Tests
243243
# https://github.com/numpy/numpy/issues/24703#issuecomment-1722379388
244244
run: |
245-
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
245+
/opt/python/cp313-cp313/bin/python -m venv ~/virtualenvs/pandas-dev
246246
. ~/virtualenvs/pandas-dev/bin/activate
247247
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.2.1 meson-python==0.13.1
248248
python -m pip install numpy -Csetup-args="-Dallow-noblas=true"
249249
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
250250
python -m pip install --no-cache-dir --no-build-isolation -e . -Csetup-args="--werror"
251251
python -m pip list --no-cache-dir
252-
export PANDAS_CI=1
253-
python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
252+
PANDAS_CI=1 python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
254253
concurrency:
255254
# https://github.community/t/concurrecy-not-work-for-push/183068/7
256255
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-32bit
@@ -259,7 +258,7 @@ jobs:
259258
Linux-Musl:
260259
runs-on: ubuntu-22.04
261260
container:
262-
image: quay.io/pypa/musllinux_1_1_x86_64
261+
image: quay.io/pypa/musllinux_1_2_x86_64
263262
steps:
264263
- name: Checkout pandas Repo
265264
# actions/checkout does not work since it requires node
@@ -281,7 +280,7 @@ jobs:
281280
apk add musl-locales
282281
- name: Build environment
283282
run: |
284-
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
283+
/opt/python/cp313-cp313/bin/python -m venv ~/virtualenvs/pandas-dev
285284
. ~/virtualenvs/pandas-dev/bin/activate
286285
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
287286
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
@@ -291,8 +290,7 @@ jobs:
291290
- name: Run Tests
292291
run: |
293292
. ~/virtualenvs/pandas-dev/bin/activate
294-
export PANDAS_CI=1
295-
python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
293+
PANDAS_CI=1 python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
296294
concurrency:
297295
# https://github.community/t/concurrecy-not-work-for-push/183068/7
298296
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-musl
@@ -357,8 +355,7 @@ jobs:
357355
python --version
358356
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
359357
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
360-
python -m pip install versioneer[toml]
361-
python -m pip install python-dateutil tzdata cython hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
358+
python -m pip install versioneer[toml] python-dateutil tzdata cython hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
362359
python -m pip install -ve . --no-build-isolation --no-index --no-deps -Csetup-args="--werror"
363360
python -m pip list
364361
@@ -375,7 +372,7 @@ jobs:
375372

376373
concurrency:
377374
# https://github.community/t/concurrecy-not-work-for-push/183068/7
378-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-python-freethreading-dev
375+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-python-freethreading-dev
379376
cancel-in-progress: true
380377

381378
env:
@@ -396,14 +393,11 @@ jobs:
396393
nogil: true
397394

398395
- name: Build Environment
399-
# TODO: Once numpy 2.2.1 is out, don't install nightly version
400-
# Tests segfault with numpy 2.2.0: https://github.com/numpy/numpy/pull/27955
401396
run: |
402397
python --version
403-
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
404-
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython numpy
405-
python -m pip install versioneer[toml]
406-
python -m pip install python-dateutil pytz tzdata hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
398+
python -m pip install --upgrade pip setuptools wheel numpy meson[ninja]==1.2.1 meson-python==0.13.1
399+
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython
400+
python -m pip install versioneer[toml] python-dateutil pytz tzdata hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
407401
python -m pip install -ve . --no-build-isolation --no-index --no-deps -Csetup-args="--werror"
408402
python -m pip list
409403

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.8.6
22+
rev: v0.9.4
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -41,7 +41,7 @@ repos:
4141
pass_filenames: true
4242
require_serial: false
4343
- repo: https://github.com/codespell-project/codespell
44-
rev: v2.3.0
44+
rev: v2.4.1
4545
hooks:
4646
- id: codespell
4747
types_or: [python, rst, markdown, cython, c]
@@ -70,7 +70,7 @@ repos:
7070
- id: trailing-whitespace
7171
args: [--markdown-linebreak-ext=md]
7272
- repo: https://github.com/PyCQA/isort
73-
rev: 5.13.2
73+
rev: 6.0.0
7474
hooks:
7575
- id: isort
7676
- repo: https://github.com/asottile/pyupgrade
@@ -95,14 +95,14 @@ repos:
9595
- id: sphinx-lint
9696
args: ["--enable", "all", "--disable", "line-too-long"]
9797
- repo: https://github.com/pre-commit/mirrors-clang-format
98-
rev: v19.1.6
98+
rev: v19.1.7
9999
hooks:
100100
- id: clang-format
101101
files: ^pandas/_libs/src|^pandas/_libs/include
102102
args: [-i]
103103
types_or: [c, c++]
104104
- repo: https://github.com/trim21/pre-commit-mirror-meson
105-
rev: v1.6.1
105+
rev: v1.7.0
106106
hooks:
107107
- id: meson-fmt
108108
args: ['--inplace']

asv_bench/benchmarks/io/style.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class Render:
1313
def setup(self, cols, rows):
1414
self.df = DataFrame(
1515
np.random.randn(rows, cols),
16-
columns=[f"float_{i+1}" for i in range(cols)],
17-
index=[f"row_{i+1}" for i in range(rows)],
16+
columns=[f"float_{i + 1}" for i in range(cols)],
17+
index=[f"row_{i + 1}" for i in range(rows)],
1818
)
1919

2020
def time_apply_render(self, cols, rows):

doc/make.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ def latex(self, force=False):
260260
for i in range(3):
261261
self._run_os("pdflatex", "-interaction=nonstopmode", "pandas.tex")
262262
raise SystemExit(
263-
"You should check the file "
264-
'"build/latex/pandas.pdf" for problems.'
263+
'You should check the file "build/latex/pandas.pdf" for problems.'
265264
)
266265
self._run_os("make")
267266
return ret_code
@@ -343,8 +342,7 @@ def main():
343342
dest="verbosity",
344343
default=0,
345344
help=(
346-
"increase verbosity (can be repeated), "
347-
"passed to the sphinx build command"
345+
"increase verbosity (can be repeated), passed to the sphinx build command"
348346
),
349347
)
350348
argparser.add_argument(

doc/source/user_guide/style.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@
12881288
"outputs": [],
12891289
"source": [
12901290
"df2.loc[:4].style.highlight_max(\n",
1291-
" axis=1, props=(\"color:white; \" \"font-weight:bold; \" \"background-color:darkblue;\")\n",
1291+
" axis=1, props=(\"color:white; font-weight:bold; background-color:darkblue;\")\n",
12921292
")"
12931293
]
12941294
},

pandas/_config/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ def reset_option(pat: str) -> None:
321321
"""
322322
Reset one or more options to their default value.
323323
324+
This method resets the specified pandas option(s) back to their default
325+
values. It allows partial string matching for convenience, but users should
326+
exercise caution to avoid unintended resets due to changes in option names
327+
in future versions.
328+
324329
Parameters
325330
----------
326331
pat : str/regex

pandas/core/apply.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,8 +1645,7 @@ def reconstruct_func(
16451645
# GH 28426 will raise error if duplicated function names are used and
16461646
# there is no reassigned name
16471647
raise SpecificationError(
1648-
"Function names must be unique if there is no new column names "
1649-
"assigned"
1648+
"Function names must be unique if there is no new column names assigned"
16501649
)
16511650
if func is None:
16521651
# nicer error message

pandas/core/arrays/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,9 +1791,11 @@ def take(self, indices, allow_fill=False, fill_value=None):
17911791
# type for the array, to the physical storage type for
17921792
# the data, before passing to take.
17931793
1794-
result = take(data, indices, fill_value=fill_value, allow_fill=allow_fill)
1794+
result = take(
1795+
data, indices, fill_value=fill_value, allow_fill=allow_fill
1796+
)
17951797
return self._from_sequence(result, dtype=self.dtype)
1796-
""" # noqa: E501
1798+
"""
17971799
# Implementer note: The `fill_value` parameter should be a user-facing
17981800
# value, an instance of self.dtype.type. When passed `fill_value=None`,
17991801
# the default of `self.dtype.na_value` should be used.

pandas/core/arrays/datetimes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,8 +2707,7 @@ def _maybe_infer_tz(tz: tzinfo | None, inferred_tz: tzinfo | None) -> tzinfo | N
27072707
pass
27082708
elif not timezones.tz_compare(tz, inferred_tz):
27092709
raise TypeError(
2710-
f"data is already tz-aware {inferred_tz}, unable to "
2711-
f"set specified tz: {tz}"
2710+
f"data is already tz-aware {inferred_tz}, unable to set specified tz: {tz}"
27122711
)
27132712
return tz
27142713

pandas/core/base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,11 @@ def array(self) -> ExtensionArray:
506506
"""
507507
The ExtensionArray of the data backing this Series or Index.
508508
509+
This property provides direct access to the underlying array data of a
510+
Series or Index without requiring conversion to a NumPy array. It
511+
returns an ExtensionArray, which is the native storage format for
512+
pandas extension dtypes.
513+
509514
Returns
510515
-------
511516
ExtensionArray

0 commit comments

Comments
 (0)