Skip to content

Commit bad439a

Browse files
authored
Merge branch 'main' into issue15675
2 parents 0414465 + ae42f3e commit bad439a

File tree

5 files changed

+27
-16
lines changed

5 files changed

+27
-16
lines changed

.github/workflows/unit-tests.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ defaults:
2222

2323
jobs:
2424
ubuntu:
25-
runs-on: ubuntu-22.04
25+
runs-on: ${{ matrix.platform }}
2626
timeout-minutes: 90
2727
strategy:
2828
matrix:
29+
platform: [ubuntu-22.04, ubuntu-24.04-arm]
2930
env_file: [actions-310.yaml, actions-311.yaml, actions-312.yaml]
3031
# Prevent the include jobs from overriding other jobs
3132
pattern: [""]
@@ -35,9 +36,11 @@ jobs:
3536
env_file: actions-311-downstream_compat.yaml
3637
pattern: "not slow and not network and not single_cpu"
3738
pytest_target: "pandas/tests/test_downstream.py"
39+
platform: ubuntu-22.04
3840
- name: "Minimum Versions"
3941
env_file: actions-310-minimum_versions.yaml
4042
pattern: "not slow and not network and not single_cpu"
43+
platform: ubuntu-22.04
4144
- name: "Locale: it_IT"
4245
env_file: actions-311.yaml
4346
pattern: "not slow and not network and not single_cpu"
@@ -48,6 +51,7 @@ jobs:
4851
# Also install it_IT (its encoding is ISO8859-1) but do not activate it.
4952
# It will be temporarily activated during tests with locale.setlocale
5053
extra_loc: "it_IT"
54+
platform: ubuntu-22.04
5155
- name: "Locale: zh_CN"
5256
env_file: actions-311.yaml
5357
pattern: "not slow and not network and not single_cpu"
@@ -58,25 +62,31 @@ jobs:
5862
# Also install zh_CN (its encoding is gb2312) but do not activate it.
5963
# It will be temporarily activated during tests with locale.setlocale
6064
extra_loc: "zh_CN"
65+
platform: ubuntu-22.04
6166
- name: "Future infer strings"
6267
env_file: actions-312.yaml
6368
pandas_future_infer_string: "1"
69+
platform: ubuntu-22.04
6470
- name: "Future infer strings (without pyarrow)"
6571
env_file: actions-311.yaml
6672
pandas_future_infer_string: "1"
73+
platform: ubuntu-22.04
6774
- name: "Pypy"
6875
env_file: actions-pypy-39.yaml
6976
pattern: "not slow and not network and not single_cpu"
7077
test_args: "--max-worker-restart 0"
78+
platform: ubuntu-22.04
7179
- name: "Numpy Dev"
7280
env_file: actions-311-numpydev.yaml
7381
pattern: "not slow and not network and not single_cpu"
7482
test_args: "-W error::DeprecationWarning -W error::FutureWarning"
83+
platform: ubuntu-22.04
7584
- name: "Pyarrow Nightly"
7685
env_file: actions-311-pyarrownightly.yaml
7786
pattern: "not slow and not network and not single_cpu"
87+
platform: ubuntu-22.04
7888
fail-fast: false
79-
name: ${{ matrix.name || format('ubuntu-latest {0}', matrix.env_file) }}
89+
name: ${{ matrix.name || format('{0} {1}', matrix.platform, matrix.env_file) }}
8090
env:
8191
PATTERN: ${{ matrix.pattern }}
8292
LANG: ${{ matrix.lang || 'C.UTF-8' }}
@@ -91,7 +101,7 @@ jobs:
91101
REMOVE_PYARROW: ${{ matrix.name == 'Future infer strings (without pyarrow)' && '1' || '0' }}
92102
concurrency:
93103
# https://github.community/t/concurrecy-not-work-for-push/183068/7
94-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.pattern }}-${{ matrix.extra_apt || '' }}-${{ matrix.pandas_future_infer_string }}
104+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.pattern }}-${{ matrix.extra_apt || '' }}-${{ matrix.pandas_future_infer_string }}-${{ matrix.platform }}
95105
cancel-in-progress: true
96106

97107
services:

.github/workflows/wheels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
buildplat:
9595
- [ubuntu-22.04, manylinux_x86_64]
9696
- [ubuntu-22.04, musllinux_x86_64]
97+
- [ubuntu-24.04-arm, manylinux_aarch64]
9798
- [macos-13, macosx_x86_64]
9899
# Note: M1 images on Github Actions start from macOS 14
99100
- [macos-14, macosx_arm64]

pandas/_libs/groupby.pyx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def group_sum(
712712
int64_t[:, ::1] nobs
713713
Py_ssize_t len_values = len(values), len_labels = len(labels)
714714
bint uses_mask = mask is not None
715-
bint isna_entry
715+
bint isna_entry, isna_result
716716

717717
if len_values != len_labels:
718718
raise ValueError("len(index) != len(labels)")
@@ -744,20 +744,18 @@ def group_sum(
744744
for j in range(K):
745745
val = values[i, j]
746746

747-
if not skipna and (
748-
(uses_mask and result_mask[lab, j]) or
749-
(is_datetimelike and sumx[lab, j] == NPY_NAT) or
750-
_treat_as_na(sumx[lab, j], False)
751-
):
752-
# If sum is already NA, don't add to it. This is important for
753-
# datetimelikebecause adding a value to NPY_NAT may not result
754-
# in a NPY_NAT
755-
continue
756-
757747
if uses_mask:
758748
isna_entry = mask[i, j]
749+
isna_result = result_mask[lab, j]
759750
else:
760751
isna_entry = _treat_as_na(val, is_datetimelike)
752+
isna_result = _treat_as_na(sumx[lab, j], is_datetimelike)
753+
754+
if not skipna and isna_result:
755+
# If sum is already NA, don't add to it. This is important for
756+
# datetimelikebecause adding a value to NPY_NAT may not result
757+
# in a NPY_NAT
758+
continue
761759

762760
if not isna_entry:
763761
nobs[lab, j] += 1

pandas/core/frame.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6890,7 +6890,8 @@ def sort_values(
68906890
builtin :meth:`sorted` function, with the notable difference that
68916891
this `key` function should be *vectorized*. It should expect a
68926892
``Series`` and return a Series with the same shape as the input.
6893-
It will be applied to each column in `by` independently.
6893+
It will be applied to each column in `by` independently. The values in the
6894+
returned Series will be used as the keys for sorting.
68946895
68956896
Returns
68966897
-------

pandas/core/generic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4884,7 +4884,8 @@ def sort_values(
48844884
builtin :meth:`sorted` function, with the notable difference that
48854885
this `key` function should be *vectorized*. It should expect a
48864886
``Series`` and return a Series with the same shape as the input.
4887-
It will be applied to each column in `by` independently.
4887+
It will be applied to each column in `by` independently. The values in the
4888+
returned Series will be used as the keys for sorting.
48884889
48894890
Returns
48904891
-------

0 commit comments

Comments
 (0)