Skip to content

Commit fa6f664

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pre-commit-ci-update-config
2 parents 581a561 + e58bf26 commit fa6f664

File tree

7 files changed

+60
-31
lines changed

7 files changed

+60
-31
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

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/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

pandas/core/frame.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13673,6 +13673,10 @@ def isin_(x):
1367313673
doc="""
1367413674
The column labels of the DataFrame.
1367513675
13676+
This property holds the column names as a pandas ``Index`` object.
13677+
It provides an immutable sequence of column labels that can be
13678+
used for data selection, renaming, and alignment in DataFrame operations.
13679+
1367613680
Returns
1367713681
-------
1367813682
pandas.Index

pandas/core/groupby/groupby.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,13 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]:
570570
"""
571571
Dict {group name -> group indices}.
572572
573+
The dictionary keys represent the group labels (e.g., timestamps for a
574+
time-based resampling operation), and the values are arrays of integer
575+
positions indicating where the elements of each group are located in the
576+
original data. This property is particularly useful when working with
577+
resampled data, as it provides insight into how the original time-series data
578+
has been grouped.
579+
573580
See Also
574581
--------
575582
core.groupby.DataFrameGroupBy.indices : Provides a mapping of group rows to
@@ -3709,14 +3716,21 @@ def rolling(
37093716
an integer index is not used to calculate the rolling window.
37103717
37113718
closed : str, default None
3712-
If ``'right'``, the first point in the window is excluded from calculations.
3719+
Determines the inclusivity of points in the window
3720+
If ``'right'``, (First, Last] the last point in the window
3721+
is included in the calculations.
3722+
3723+
If ``'left'``, [First, Last) the first point in the window
3724+
is included in the calculations.
37133725
3714-
If ``'left'``, the last point in the window is excluded from calculations.
3726+
If ``'both'``, [First, Last] all points in the window
3727+
are included in the calculations.
37153728
3716-
If ``'both'``, no points in the window are excluded from calculations.
3729+
If ``'neither'``, (First, Last) the first and last points
3730+
in the window are excludedfrom calculations.
37173731
3718-
If ``'neither'``, the first and last points in the window are excluded
3719-
from calculations.
3732+
() and [] are referencing open and closed set
3733+
notation respetively.
37203734
37213735
Default ``None`` (``'right'``).
37223736

pandas/core/reshape/tile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def cut(
7373
7474
Parameters
7575
----------
76-
x : array-like
76+
x : 1d ndarray or Series
7777
The input array to be binned. Must be 1-dimensional.
7878
bins : int, sequence of scalars, or IntervalIndex
7979
The criteria to bin by.
@@ -126,7 +126,7 @@ def cut(
126126
Categorical for all other inputs. The values stored within
127127
are whatever the type in the sequence is.
128128
129-
* False : returns an ndarray of integers.
129+
* False : returns a 1d ndarray or Series of integers.
130130
131131
bins : numpy.ndarray or IntervalIndex.
132132
The computed or specified bins. Only returned when `retbins=True`.

pandas/core/window/rolling.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -929,14 +929,21 @@ class Window(BaseWindow):
929929
an integer index is not used to calculate the rolling window.
930930
931931
closed : str, default None
932-
If ``'right'``, the first point in the window is excluded from calculations.
932+
Determines the inclusivity of points in the window
933+
If ``'right'``, (First, Last] the last point in the window
934+
is included in the calculations.
933935
934-
If ``'left'``, the last point in the window is excluded from calculations.
936+
If ``'left'``, [First, Last) the first point in the window
937+
is included in the calculations.
935938
936-
If ``'both'``, no point in the window is excluded from calculations.
939+
If ``'both'``, [First, Last] all points in the window
940+
are included in the calculations.
937941
938-
If ``'neither'``, the first and last points in the window are excluded
939-
from calculations.
942+
If ``'neither'``, (First, Last) the first and last points
943+
in the window are excludedfrom calculations.
944+
945+
() and [] are referencing open and closed set
946+
notation respetively.
940947
941948
Default ``None`` (``'right'``).
942949

0 commit comments

Comments
 (0)