Skip to content

Commit 95415ff

Browse files
authored
Merge branch 'main' into deps/pytz/optional
2 parents 62cc55e + f9232ff commit 95415ff

File tree

33 files changed

+434
-105
lines changed

33 files changed

+434
-105
lines changed

.circleci/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
- run:
1717
name: Install Environment and Run Tests
1818
shell: /bin/bash -exo pipefail
19+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
1920
command: |
2021
MINI_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Miniforge3-24.3.0-0-Linux-aarch64.sh"
2122
wget -q $MINI_URL -O Miniforge3.sh
@@ -33,6 +34,7 @@ jobs:
3334
fi
3435
python -m pip install --no-build-isolation -ve . --config-settings=setup-args="--werror"
3536
PATH=$HOME/miniconda3/envs/pandas-dev/bin:$HOME/miniconda3/condabin:$PATH
37+
sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
3638
ci/run_tests.sh
3739
test-linux-musl:
3840
docker:
@@ -89,8 +91,8 @@ jobs:
8991
name: Build aarch64 wheels
9092
no_output_timeout: 30m # Sometimes the tests won't generate any output, make sure the job doesn't get killed by that
9193
command: |
92-
pip3 install cibuildwheel==2.18.1
93-
cibuildwheel --prerelease-pythons --output-dir wheelhouse
94+
pip3 install cibuildwheel==2.20.0
95+
cibuildwheel --output-dir wheelhouse
9496
9597
environment:
9698
CIBW_BUILD: << parameters.cibw-build >>

.github/workflows/code-checks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ jobs:
5151
# TODO: The doctests have to be run first right now, since the Cython doctests only work
5252
# with pandas installed in non-editable mode
5353
# This can be removed once pytest-cython doesn't require C extensions to be installed inplace
54+
55+
- name: Extra installs
56+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
57+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
58+
5459
- name: Run doctests
5560
run: cd ci && ./code_checks.sh doctests
5661
if: ${{ steps.build.outcome == 'success' && always() }}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ jobs:
4646
- name: Build Pandas
4747
uses: ./.github/actions/build_pandas
4848

49+
- name: Extra installs
50+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
51+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
52+
4953
- name: Test website
5054
run: python -m pytest web/
5155

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ jobs:
134134
fetch-depth: 0
135135

136136
- name: Extra installs
137-
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.extra_apt }}
138-
if: ${{ matrix.extra_apt }}
137+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
138+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0 ${{ matrix.extra_apt || ''}}
139139

140140
- name: Generate extra locales
141141
# These extra locales will be available for locale.setlocale() calls in tests

.github/workflows/wheels.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,10 @@ jobs:
158158
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
159159

160160
- name: Build wheels
161-
uses: pypa/cibuildwheel@v2.19.2
161+
uses: pypa/cibuildwheel@v2.20.0
162162
with:
163163
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
164164
env:
165-
CIBW_PRERELEASE_PYTHONS: True
166165
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
167166
CIBW_BUILD_FRONTEND: ${{ matrix.cibw_build_frontend || 'pip' }}
168167
CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }}

ci/code_checks.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7070
--format=actions \
7171
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
73-
-i "pandas.MultiIndex.get_level_values SA01" \
7473
-i "pandas.MultiIndex.get_loc_level PR07" \
7574
-i "pandas.MultiIndex.names SA01" \
7675
-i "pandas.MultiIndex.reorder_levels RT03,SA01" \
@@ -165,9 +164,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
165164
-i "pandas.Series.str.center RT03,SA01" \
166165
-i "pandas.Series.str.decode PR07,RT03,SA01" \
167166
-i "pandas.Series.str.encode PR07,RT03,SA01" \
168-
-i "pandas.Series.str.find RT03" \
169-
-i "pandas.Series.str.fullmatch RT03" \
170-
-i "pandas.Series.str.get RT03,SA01" \
171167
-i "pandas.Series.str.index RT03" \
172168
-i "pandas.Series.str.ljust RT03,SA01" \
173169
-i "pandas.Series.str.lower RT03" \
@@ -177,7 +173,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
177173
-i "pandas.Series.str.partition RT03" \
178174
-i "pandas.Series.str.repeat SA01" \
179175
-i "pandas.Series.str.replace SA01" \
180-
-i "pandas.Series.str.rfind RT03" \
181176
-i "pandas.Series.str.rindex RT03" \
182177
-i "pandas.Series.str.rjust RT03,SA01" \
183178
-i "pandas.Series.str.rpartition RT03" \
@@ -267,9 +262,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
267262
-i "pandas.api.extensions.ExtensionArray.tolist RT03,SA01" \
268263
-i "pandas.api.extensions.ExtensionArray.unique RT03,SA01" \
269264
-i "pandas.api.extensions.ExtensionArray.view SA01" \
270-
-i "pandas.api.indexers.VariableOffsetWindowIndexer PR01,SA01" \
271265
-i "pandas.api.interchange.from_dataframe RT03,SA01" \
272-
-i "pandas.api.types.is_any_real_numeric_dtype SA01" \
273266
-i "pandas.api.types.is_bool PR01,SA01" \
274267
-i "pandas.api.types.is_bool_dtype SA01" \
275268
-i "pandas.api.types.is_categorical_dtype SA01" \
@@ -296,7 +289,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
296289
-i "pandas.api.types.is_period_dtype SA01" \
297290
-i "pandas.api.types.is_re PR07,SA01" \
298291
-i "pandas.api.types.is_re_compilable PR07,SA01" \
299-
-i "pandas.api.types.is_sparse SA01" \
300292
-i "pandas.api.types.is_timedelta64_ns_dtype SA01" \
301293
-i "pandas.api.types.pandas_dtype PR07,RT03,SA01" \
302294
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \

doc/source/development/contributing.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ If you are new to Git, you can reference some of these resources for learning Gi
7474
to the :ref:`contributor community <community>` for help if needed:
7575

7676
* `Git documentation <https://git-scm.com/doc>`_.
77-
* `Numpy's Git resources <https://numpy.org/doc/stable/dev/gitwash/git_resources.html>`_ tutorial.
7877

7978
Also, the project follows a forking workflow further described on this page whereby
8079
contributors fork the repository, make changes and then create a pull request.

doc/source/user_guide/basics.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,6 @@ speedups. ``numexpr`` uses smart chunking, caching, and multiple cores. ``bottle
155155
a set of specialized cython routines that are especially fast when dealing with arrays that have
156156
``nans``.
157157

158-
Here is a sample (using 100 column x 100,000 row ``DataFrames``):
159-
160-
.. csv-table::
161-
:header: "Operation", "0.11.0 (ms)", "Prior Version (ms)", "Ratio to Prior"
162-
:widths: 25, 25, 25, 25
163-
164-
``df1 > df2``, 13.32, 125.35, 0.1063
165-
``df1 * df2``, 21.71, 36.63, 0.5928
166-
``df1 + df2``, 22.04, 36.50, 0.6039
167-
168158
You are highly encouraged to install both libraries. See the section
169159
:ref:`Recommended Dependencies <install.recommended_dependencies>` for more installation info.
170160

doc/source/whatsnew/v3.0.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ Strings
580580

581581
Interval
582582
^^^^^^^^
583+
- :meth:`Index.is_monotonic_decreasing`, :meth:`Index.is_monotonic_increasing`, and :meth:`Index.is_unique` could incorrectly be ``False`` for an ``Index`` created from a slice of another ``Index``. (:issue:`57911`)
583584
- Bug in :func:`interval_range` where start and end numeric types were always cast to 64 bit (:issue:`57268`)
584585
-
585586

@@ -642,6 +643,7 @@ Groupby/resample/rolling
642643
- Bug in :meth:`DataFrameGroupBy.agg` that raises ``AttributeError`` when there is dictionary input and duplicated columns, instead of returning a DataFrame with the aggregation of all duplicate columns. (:issue:`55041`)
643644
- Bug in :meth:`DataFrameGroupBy.apply` that was returning a completely empty DataFrame when all return values of ``func`` were ``None`` instead of returning an empty DataFrame with the original columns and dtypes. (:issue:`57775`)
644645
- Bug in :meth:`DataFrameGroupBy.apply` with ``as_index=False`` that was returning :class:`MultiIndex` instead of returning :class:`Index`. (:issue:`58291`)
646+
- Bug in :meth:`DataFrameGroupBy.cumsum` and :meth:`DataFrameGroupBy.cumprod` where ``numeric_only`` parameter was passed indirectly through kwargs instead of passing directly. (:issue:`58811`)
645647
- Bug in :meth:`DataFrameGroupBy.cumsum` where it did not return the correct dtype when the label contained ``None``. (:issue:`58811`)
646648
- Bug in :meth:`DataFrameGroupby.transform` and :meth:`SeriesGroupby.transform` with a reducer and ``observed=False`` that coerces dtype to float when there are unobserved categories. (:issue:`55326`)
647649
- Bug in :meth:`Rolling.apply` where the applied function could be called on fewer than ``min_period`` periods if ``method="table"``. (:issue:`58868`)

pandas/_libs/index.pyx

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,24 @@ cdef class IndexEngine:
252252
return self.sizeof()
253253

254254
cpdef _update_from_sliced(self, IndexEngine other, reverse: bool):
255-
self.unique = other.unique
256-
self.need_unique_check = other.need_unique_check
255+
if other.unique:
256+
self.unique = other.unique
257+
self.need_unique_check = other.need_unique_check
258+
257259
if not other.need_monotonic_check and (
258260
other.is_monotonic_increasing or other.is_monotonic_decreasing):
259-
self.need_monotonic_check = other.need_monotonic_check
260-
# reverse=True means the index has been reversed
261-
self.monotonic_inc = other.monotonic_dec if reverse else other.monotonic_inc
262-
self.monotonic_dec = other.monotonic_inc if reverse else other.monotonic_dec
261+
self.need_monotonic_check = 0
262+
if len(self.values) > 0 and self.values[0] != self.values[-1]:
263+
# reverse=True means the index has been reversed
264+
if reverse:
265+
self.monotonic_inc = other.monotonic_dec
266+
self.monotonic_dec = other.monotonic_inc
267+
else:
268+
self.monotonic_inc = other.monotonic_inc
269+
self.monotonic_dec = other.monotonic_dec
270+
else:
271+
self.monotonic_inc = 1
272+
self.monotonic_dec = 1
263273

264274
@property
265275
def is_unique(self) -> bool:
@@ -882,14 +892,24 @@ cdef class SharedEngine:
882892
pass
883893

884894
cpdef _update_from_sliced(self, ExtensionEngine other, reverse: bool):
885-
self.unique = other.unique
886-
self.need_unique_check = other.need_unique_check
895+
if other.unique:
896+
self.unique = other.unique
897+
self.need_unique_check = other.need_unique_check
898+
887899
if not other.need_monotonic_check and (
888900
other.is_monotonic_increasing or other.is_monotonic_decreasing):
889-
self.need_monotonic_check = other.need_monotonic_check
890-
# reverse=True means the index has been reversed
891-
self.monotonic_inc = other.monotonic_dec if reverse else other.monotonic_inc
892-
self.monotonic_dec = other.monotonic_inc if reverse else other.monotonic_dec
901+
self.need_monotonic_check = 0
902+
if len(self.values) > 0 and self.values[0] != self.values[-1]:
903+
# reverse=True means the index has been reversed
904+
if reverse:
905+
self.monotonic_inc = other.monotonic_dec
906+
self.monotonic_dec = other.monotonic_inc
907+
else:
908+
self.monotonic_inc = other.monotonic_inc
909+
self.monotonic_dec = other.monotonic_dec
910+
else:
911+
self.monotonic_inc = 1
912+
self.monotonic_dec = 1
893913

894914
@property
895915
def is_unique(self) -> bool:

0 commit comments

Comments
 (0)