Skip to content

Commit 01d1fc6

Browse files
committed
merged incoming changes from main brnach into index_dtype_api_deprecation
2 parents 8888596 + c989cdb commit 01d1fc6

File tree

361 files changed

+8014
-4960
lines changed

Some content is hidden

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

361 files changed

+8014
-4960
lines changed

.github/actions/setup-conda/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
- name: Set Arrow version in ${{ inputs.environment-file }} to ${{ inputs.pyarrow-version }}
1919
run: |
2020
grep -q ' - pyarrow' ${{ inputs.environment-file }}
21-
sed -i"" -e "s/ - pyarrow<10/ - pyarrow=${{ inputs.pyarrow-version }}/" ${{ inputs.environment-file }}
21+
sed -i"" -e "s/ - pyarrow/ - pyarrow=${{ inputs.pyarrow-version }}/" ${{ inputs.environment-file }}
2222
cat ${{ inputs.environment-file }}
2323
shell: bash
2424
if: ${{ inputs.pyarrow-version }}

.github/workflows/code-checks.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
with:
4040
extra_args: --verbose --all-files
4141

42-
docstring_typing_pylint:
43-
name: Docstring validation, typing, and pylint
42+
docstring_typing_manual_hooks:
43+
name: Docstring validation, typing, and other manual pre-commit hooks
4444
runs-on: ubuntu-22.04
4545
defaults:
4646
run:

.github/workflows/codeql.yml

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ concurrency:
88
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
99
cancel-in-progress: true
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
analyze:
1316
runs-on: ubuntu-22.04

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

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
env:
1616
ENV_FILE: environment.yml
1717
PANDAS_CI: 1
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1819

1920
permissions:
2021
contents: read
@@ -45,6 +46,12 @@ jobs:
4546
- name: Build Pandas
4647
uses: ./.github/actions/build_pandas
4748

49+
- name: Set up maintainers cache
50+
uses: actions/cache@v3
51+
with:
52+
path: maintainers.json
53+
key: maintainers
54+
4855
- name: Build website
4956
run: python web/pandas_web.py web/pandas --target-path=web/build
5057

.github/workflows/macos-windows.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616
PANDAS_CI: 1
1717
PYTEST_TARGET: pandas
1818
PATTERN: "not slow and not db and not network and not single_cpu"
19+
ERROR_ON_WARNINGS: "1"
1920

2021

2122
permissions:
@@ -52,7 +53,7 @@ jobs:
5253
uses: ./.github/actions/setup-conda
5354
with:
5455
environment-file: ci/deps/${{ matrix.env_file }}
55-
pyarrow-version: ${{ matrix.os == 'macos-latest' && '6' || '' }}
56+
pyarrow-version: ${{ matrix.os == 'macos-latest' && '9' || '' }}
5657

5758
- name: Build Pandas
5859
uses: ./.github/actions/build_pandas

.github/workflows/scorecards.yml

-54
This file was deleted.

.github/workflows/ubuntu.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
matrix:
3030
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml]
3131
pattern: ["not single_cpu", "single_cpu"]
32-
pyarrow_version: ["7", "8", "9"]
32+
pyarrow_version: ["7", "8", "9", "10"]
3333
include:
3434
- name: "Downstream Compat"
3535
env_file: actions-38-downstream_compat.yaml
@@ -38,6 +38,7 @@ jobs:
3838
- name: "Minimum Versions"
3939
env_file: actions-38-minimum_versions.yaml
4040
pattern: "not slow and not network and not single_cpu"
41+
error_on_warnings: "0"
4142
- name: "Locale: it_IT"
4243
env_file: actions-38.yaml
4344
pattern: "not slow and not network and not single_cpu"
@@ -62,33 +63,42 @@ jobs:
6263
env_file: actions-310.yaml
6364
pattern: "not slow and not network and not single_cpu"
6465
pandas_copy_on_write: "1"
66+
error_on_warnings: "0"
6567
- name: "Data Manager"
6668
env_file: actions-38.yaml
6769
pattern: "not slow and not network and not single_cpu"
6870
pandas_data_manager: "array"
71+
error_on_warnings: "0"
6972
- name: "Pypy"
7073
env_file: actions-pypy-38.yaml
7174
pattern: "not slow and not network and not single_cpu"
7275
test_args: "--max-worker-restart 0"
76+
error_on_warnings: "0"
7377
- name: "Numpy Dev"
7478
env_file: actions-310-numpydev.yaml
7579
pattern: "not slow and not network and not single_cpu"
7680
test_args: "-W error::DeprecationWarning:numpy -W error::FutureWarning:numpy"
81+
error_on_warnings: "0"
7782
exclude:
78-
- env_file: actions-39.yaml
79-
pyarrow_version: "6"
80-
- env_file: actions-39.yaml
83+
- env_file: actions-38.yaml
8184
pyarrow_version: "7"
82-
- env_file: actions-310.yaml
83-
pyarrow_version: "6"
84-
- env_file: actions-310.yaml
85+
- env_file: actions-38.yaml
86+
pyarrow_version: "8"
87+
- env_file: actions-38.yaml
88+
pyarrow_version: "9"
89+
- env_file: actions-39.yaml
8590
pyarrow_version: "7"
91+
- env_file: actions-39.yaml
92+
pyarrow_version: "8"
93+
- env_file: actions-39.yaml
94+
pyarrow_version: "9"
8695
fail-fast: false
8796
name: ${{ matrix.name || format('{0} pyarrow={1} {2}', matrix.env_file, matrix.pyarrow_version, matrix.pattern) }}
8897
env:
8998
ENV_FILE: ci/deps/${{ matrix.env_file }}
9099
PATTERN: ${{ matrix.pattern }}
91100
EXTRA_APT: ${{ matrix.extra_apt || '' }}
101+
ERROR_ON_WARNINGS: ${{ matrix.error_on_warnings || '1' }}
92102
LANG: ${{ matrix.lang || '' }}
93103
LC_ALL: ${{ matrix.lc_all || '' }}
94104
PANDAS_DATA_MANAGER: ${{ matrix.pandas_data_manager || 'block' }}

.github/workflows/wheels.yml

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ concurrency:
3030
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3131
cancel-in-progress: true
3232

33+
permissions:
34+
contents: read
35+
3336
jobs:
3437
build_wheels:
3538
name: Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}

.pre-commit-config.yaml

+40-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
minimum_pre_commit_version: 2.15.0
22
exclude: ^LICENSES/|\.(html|csv|svg)$
3-
# reserve "manual" for mypy and pyright
4-
default_stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
3+
# reserve "manual" for relatively slow hooks which we still want to run in CI
4+
default_stages: [
5+
commit,
6+
merge-commit,
7+
push,
8+
prepare-commit-msg,
9+
commit-msg,
10+
post-checkout,
11+
post-commit,
12+
post-merge,
13+
post-rewrite
14+
]
515
ci:
616
autofix_prs: false
717
repos:
@@ -24,7 +34,7 @@ repos:
2434
types_or: [python, rst, markdown]
2535
additional_dependencies: [tomli]
2636
- repo: https://github.com/MarcoGorelli/cython-lint
27-
rev: v0.9.1
37+
rev: v0.10.1
2838
hooks:
2939
- id: cython-lint
3040
- id: double-quote-cython-strings
@@ -34,9 +44,11 @@ repos:
3444
- id: debug-statements
3545
- id: end-of-file-fixer
3646
exclude: \.txt$
37-
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
47+
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg,
48+
post-checkout, post-commit, post-merge, post-rewrite]
3849
- id: trailing-whitespace
39-
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
50+
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg,
51+
post-checkout, post-commit, post-merge, post-rewrite]
4052
- repo: https://github.com/cpplint/cpplint
4153
rev: 1.6.1
4254
hooks:
@@ -46,7 +58,14 @@ repos:
4658
# this particular codebase (e.g. src/headers, src/klib). However,
4759
# we can lint all header files since they aren't "generated" like C files are.
4860
exclude: ^pandas/_libs/src/(klib|headers)/
49-
args: [--quiet, '--extensions=c,h', '--headers=h', --recursive, '--filter=-readability/casting,-runtime/int,-build/include_subdir']
61+
args: [
62+
--quiet,
63+
'--extensions=c,h',
64+
'--headers=h',
65+
--recursive,
66+
--linelength=88,
67+
'--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size'
68+
]
5069
- repo: https://github.com/PyCQA/flake8
5170
rev: 6.0.0
5271
hooks:
@@ -58,12 +77,12 @@ repos:
5877
- flake8-bugbear==22.7.1
5978
- pandas-dev-flaker==0.5.0
6079
- repo: https://github.com/pycqa/pylint
61-
rev: v2.15.6
80+
rev: v2.15.9
6281
hooks:
6382
- id: pylint
6483
stages: [manual]
6584
- repo: https://github.com/pycqa/pylint
66-
rev: v2.15.6
85+
rev: v2.15.9
6786
hooks:
6887
- id: pylint
6988
alias: redefined-outer-name
@@ -76,15 +95,14 @@ repos:
7695
|^pandas/util/_test_decorators\.py # keep excluded
7796
|^pandas/_version\.py # keep excluded
7897
|^pandas/conftest\.py # keep excluded
79-
|^pandas/core/generic\.py
8098
args: [--disable=all, --enable=redefined-outer-name]
8199
stages: [manual]
82100
- repo: https://github.com/PyCQA/isort
83-
rev: 5.10.1
101+
rev: 5.11.4
84102
hooks:
85103
- id: isort
86104
- repo: https://github.com/asottile/pyupgrade
87-
rev: v3.2.2
105+
rev: v3.3.1
88106
hooks:
89107
- id: pyupgrade
90108
args: [--py38-plus]
@@ -107,6 +125,7 @@ repos:
107125
hooks:
108126
- id: yesqa
109127
additional_dependencies: *flake8_dependencies
128+
stages: [manual]
110129
- repo: local
111130
hooks:
112131
# NOTE: we make `black` a local hook because if it's installed from
@@ -214,7 +233,6 @@ repos:
214233
exclude: ^pandas/tests/extension/base/base\.py
215234
- id: pip-to-conda
216235
name: Generate pip dependency from conda
217-
description: This hook checks if the conda environment.yml and requirements-dev.txt are equal
218236
language: python
219237
entry: python scripts/generate_pip_deps_from_conda.py
220238
files: ^(environment.yml|requirements-dev.txt)$
@@ -311,6 +329,16 @@ repos:
311329
files: ^pandas
312330
exclude: ^(pandas/tests|pandas/_version.py|pandas/io/clipboard)
313331
language: python
332+
stages: [manual]
314333
additional_dependencies:
315334
- autotyping==22.9.0
316335
- libcst==0.4.7
336+
- id: check-test-naming
337+
name: check that test names start with 'test'
338+
entry: python -m scripts.check_test_naming
339+
types: [python]
340+
files: ^pandas/tests
341+
language: python
342+
exclude: |
343+
(?x)
344+
^pandas/tests/generic/test_generic.py # GH50380

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ RUN apt-get install -y build-essential
88
RUN apt-get install -y libhdf5-dev
99

1010
RUN python -m pip install --upgrade pip
11-
RUN python -m pip install --use-deprecated=legacy-resolver \
11+
RUN python -m pip install \
1212
-r https://raw.githubusercontent.com/pandas-dev/pandas/main/requirements-dev.txt
1313
CMD ["/bin/bash"]

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
[![Package Status](https://img.shields.io/pypi/status/pandas.svg)](https://pypi.org/project/pandas/)
1212
[![License](https://img.shields.io/pypi/l/pandas.svg)](https://github.com/pandas-dev/pandas/blob/main/LICENSE)
1313
[![Coverage](https://codecov.io/github/pandas-dev/pandas/coverage.svg?branch=main)](https://codecov.io/gh/pandas-dev/pandas)
14-
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/pandas-dev/pandas/badge)](https://api.securityscorecards.dev/projects/github.com/pandas-dev/pandas)
1514
[![Downloads](https://static.pepy.tech/personalized-badge/pandas?period=month&units=international_system&left_color=black&right_color=orange&left_text=PyPI%20downloads%20per%20month)](https://pepy.tech/project/pandas)
1615
[![Slack](https://img.shields.io/badge/join_Slack-information-brightgreen.svg?logo=slack)](https://pandas.pydata.org/docs/dev/development/community.html?highlight=slack#community-slack)
1716
[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org)

asv_bench/asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// pip (with all the conda available packages installed first,
4242
// followed by the pip installed packages).
4343
"matrix": {
44-
"numpy": [],
44+
"numpy": ["1.23.5"], // https://github.com/pandas-dev/pandas/pull/50356
4545
"Cython": ["0.29.32"],
4646
"matplotlib": [],
4747
"sqlalchemy": [],

asv_bench/benchmarks/array.py

+41
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,46 @@ def time_setitem_list(self, multiple_chunks):
9090
def time_setitem_slice(self, multiple_chunks):
9191
self.array[::10] = "foo"
9292

93+
def time_setitem_null_slice(self, multiple_chunks):
94+
self.array[:] = "foo"
95+
9396
def time_tolist(self, multiple_chunks):
9497
self.array.tolist()
98+
99+
100+
class ArrowExtensionArray:
101+
102+
params = [
103+
[
104+
"boolean[pyarrow]",
105+
"float64[pyarrow]",
106+
"int64[pyarrow]",
107+
"string[pyarrow]",
108+
"timestamp[ns][pyarrow]",
109+
],
110+
[False, True],
111+
]
112+
param_names = ["dtype", "hasna"]
113+
114+
def setup(self, dtype, hasna):
115+
N = 100_000
116+
if dtype == "boolean[pyarrow]":
117+
data = np.random.choice([True, False], N, replace=True)
118+
elif dtype == "float64[pyarrow]":
119+
data = np.random.randn(N)
120+
elif dtype == "int64[pyarrow]":
121+
data = np.arange(N)
122+
elif dtype == "string[pyarrow]":
123+
data = tm.rands_array(10, N)
124+
elif dtype == "timestamp[ns][pyarrow]":
125+
data = pd.date_range("2000-01-01", freq="s", periods=N)
126+
else:
127+
raise NotImplementedError
128+
129+
arr = pd.array(data, dtype=dtype)
130+
if hasna:
131+
arr[::2] = pd.NA
132+
self.arr = arr
133+
134+
def time_to_numpy(self, dtype, hasna):
135+
self.arr.to_numpy()

0 commit comments

Comments
 (0)