Skip to content

Commit fcb1c74

Browse files
Merge branch 'main' into Subtraction-fails-with-matching-index-of-different-name-and-type-pandas-dev#57524
2 parents 85c82bf + 669ddfb commit fcb1c74

File tree

474 files changed

+5642
-6731
lines changed

Some content is hidden

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

474 files changed

+5642
-6731
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
jobs:
44
test-arm:
55
machine:
6-
image: ubuntu-2004:2022.04.1
6+
image: default
77
resource_class: arm.large
88
environment:
99
ENV_FILE: ci/deps/circle-310-arm64.yaml
@@ -46,7 +46,7 @@ jobs:
4646
cibw-build:
4747
type: string
4848
machine:
49-
image: ubuntu-2004:2022.04.1
49+
image: default
5050
resource_class: arm.large
5151
environment:
5252
TRIGGER_SOURCE: << pipeline.trigger_source >>

.github/actions/run-tests/action.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
name: Run tests and report results
2-
inputs:
3-
preload:
4-
description: Preload arguments for sanitizer
5-
required: false
6-
asan_options:
7-
description: Arguments for Address Sanitizer (ASAN)
8-
required: false
92
runs:
103
using: composite
114
steps:
125
- name: Test
13-
run: ${{ inputs.asan_options }} ${{ inputs.preload }} ci/run_tests.sh
6+
run: ci/run_tests.sh
147
shell: bash -el {0}
158

169
- name: Publish test results

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,6 @@ jobs:
6868
- name: "Pyarrow Nightly"
6969
env_file: actions-311-pyarrownightly.yaml
7070
pattern: "not slow and not network and not single_cpu"
71-
- name: "ASAN / UBSAN"
72-
env_file: actions-311-sanitizers.yaml
73-
pattern: "not slow and not network and not single_cpu and not skip_ubsan"
74-
asan_options: "ASAN_OPTIONS=detect_leaks=0"
75-
preload: LD_PRELOAD=$(gcc -print-file-name=libasan.so)
76-
meson_args: --config-settings=setup-args="-Db_sanitize=address,undefined"
77-
cflags_adds: -fno-sanitize-recover=all
78-
pytest_workers: -1 # disable pytest-xdist as it swallows stderr from ASAN
7971
fail-fast: false
8072
name: ${{ matrix.name || format('ubuntu-latest {0}', matrix.env_file) }}
8173
env:
@@ -161,18 +153,12 @@ jobs:
161153
- name: Test (not single_cpu)
162154
uses: ./.github/actions/run-tests
163155
if: ${{ matrix.name != 'Pypy' }}
164-
with:
165-
preload: ${{ matrix.preload }}
166-
asan_options: ${{ matrix.asan_options }}
167156
env:
168157
# Set pattern to not single_cpu if not already set
169158
PATTERN: ${{ env.PATTERN == '' && 'not single_cpu' || matrix.pattern }}
170159

171160
- name: Test (single_cpu)
172161
uses: ./.github/actions/run-tests
173-
with:
174-
preload: ${{ matrix.preload }}
175-
asan_options: ${{ matrix.asan_options }}
176162
env:
177163
PATTERN: 'single_cpu'
178164
PYTEST_WORKERS: 0

.github/workflows/wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141

142142
- name: Build normal wheels
143143
if: ${{ (env.IS_SCHEDULE_DISPATCH != 'true' || env.IS_PUSH == 'true') }}
144-
uses: pypa/cibuildwheel@v2.16.5
144+
uses: pypa/cibuildwheel@v2.17.0
145145
with:
146146
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
147147
env:
@@ -150,7 +150,7 @@ jobs:
150150

151151
- name: Build nightly wheels (with NumPy pre-release)
152152
if: ${{ (env.IS_SCHEDULE_DISPATCH == 'true' && env.IS_PUSH != 'true') }}
153-
uses: pypa/cibuildwheel@v2.16.5
153+
uses: pypa/cibuildwheel@v2.17.0
154154
with:
155155
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
156156
env:

.pre-commit-config.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pylint, pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.1.13
22+
rev: v0.3.1
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -30,6 +30,12 @@ repos:
3030
files: ^pandas
3131
exclude: ^pandas/tests
3232
args: [--select, "ANN001,ANN2", --fix-only, --exit-non-zero-on-fix]
33+
- id: ruff
34+
name: ruff-use-pd_array-in-core
35+
alias: ruff-use-pd_array-in-core
36+
files: ^pandas/core/
37+
exclude: ^pandas/core/api\.py$
38+
args: [--select, "ICN001", --exit-non-zero-on-fix]
3339
- id: ruff-format
3440
exclude: ^scripts
3541
- repo: https://github.com/jendrikseipp/vulture
@@ -72,7 +78,7 @@ repos:
7278
hooks:
7379
- id: pylint
7480
stages: [manual]
75-
args: [--load-plugins=pylint.extensions.redefined_loop_name]
81+
args: [--load-plugins=pylint.extensions.redefined_loop_name, --fail-on=I0021]
7682
- id: pylint
7783
alias: redefined-outer-name
7884
name: Redefining name from outer scope
@@ -272,13 +278,6 @@ repos:
272278
language: python
273279
entry: python scripts/validate_unwanted_patterns.py --validation-type="nodefault_used_not_only_for_typing"
274280
types: [python]
275-
- id: use-pd_array-in-core
276-
name: Import pandas.array as pd_array in core
277-
language: python
278-
entry: python scripts/use_pd_array_in_core.py
279-
files: ^pandas/core/
280-
exclude: ^pandas/core/api\.py$
281-
types: [python]
282281
- id: no-return-exception
283282
name: Use raise instead of return for exceptions
284283
language: pygrep

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN apt-get install -y build-essential
99
RUN apt-get install -y libhdf5-dev libgles2-mesa-dev
1010

1111
RUN python -m pip install --upgrade pip
12-
RUN python -m pip install \
13-
-r https://raw.githubusercontent.com/pandas-dev/pandas/main/requirements-dev.txt
12+
COPY requirements-dev.txt /tmp
13+
RUN python -m pip install -r /tmp/requirements-dev.txt
14+
RUN git config --global --add safe.directory /home/pandas
1415
CMD ["/bin/bash"]

asv_bench/benchmarks/indexing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
lower-level methods directly on Index and subclasses, see index_object.py,
44
indexing_engine.py, and index_cached.py
55
"""
6+
67
from datetime import datetime
78
import warnings
89

asv_bench/benchmarks/join_merge.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,23 @@ def time_i8merge(self, how):
328328
merge(self.left, self.right, how=how)
329329

330330

331+
class UniqueMerge:
332+
params = [4_000_000, 1_000_000]
333+
param_names = ["unique_elements"]
334+
335+
def setup(self, unique_elements):
336+
N = 1_000_000
337+
self.left = DataFrame({"a": np.random.randint(1, unique_elements, (N,))})
338+
self.right = DataFrame({"a": np.random.randint(1, unique_elements, (N,))})
339+
uniques = self.right.a.drop_duplicates()
340+
self.right["a"] = concat(
341+
[uniques, Series(np.arange(0, -(N - len(uniques)), -1))], ignore_index=True
342+
)
343+
344+
def time_unique_merge(self, unique_elements):
345+
merge(self.left, self.right, how="inner")
346+
347+
331348
class MergeDatetime:
332349
params = [
333350
[

asv_bench/benchmarks/libs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
If a PR does not edit anything in _libs/, then it is unlikely that the
66
benchmarks will be affected.
77
"""
8+
89
import numpy as np
910

1011
from pandas._libs.lib import (

asv_bench/benchmarks/package.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Benchmarks for pandas at the package-level.
33
"""
4+
45
import subprocess
56
import sys
67

asv_bench/benchmarks/period.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Period benchmarks with non-tslibs dependencies. See
33
benchmarks.tslibs.period for benchmarks that rely only on tslibs.
44
"""
5+
56
from pandas import (
67
DataFrame,
78
Period,

asv_bench/benchmarks/stat_ops.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def setup(self, op, axis):
3333
("median", 1),
3434
("median", None),
3535
("std", 1),
36+
("std", None),
3637
)
3738
):
3839
# Skipping cases where datetime aggregations are not implemented

asv_bench/benchmarks/timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def setup(self):
183183
self.dt_ts = Series(5, rng3, dtype="datetime64[ns]")
184184

185185
def time_resample(self):
186-
self.dt_ts.resample("1S").last()
186+
self.dt_ts.resample("1s").last()
187187

188188

189189
class AsOf:

asv_bench/benchmarks/tslibs/offsets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
offsets benchmarks that rely only on tslibs. See benchmarks.offset for
33
offsets benchmarks that rely on other parts of pandas.
44
"""
5+
56
from datetime import datetime
67

78
import numpy as np

asv_bench/benchmarks/tslibs/resolution.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
df.loc[key] = (val.average, val.stdev)
1818
1919
"""
20+
2021
import numpy as np
2122

2223
try:

asv_bench/benchmarks/tslibs/timedelta.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Timedelta benchmarks that rely only on tslibs. See benchmarks.timedeltas for
33
Timedelta benchmarks that rely on other parts of pandas.
44
"""
5+
56
import datetime
67

78
import numpy as np

asv_bench/benchmarks/tslibs/tslib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
val = %timeit -o tr.time_ints_to_pydatetime(box, size, tz)
1616
df.loc[key] = (val.average, val.stdev)
1717
"""
18+
1819
from datetime import (
1920
timedelta,
2021
timezone,

0 commit comments

Comments
 (0)