Skip to content

Commit c989cdb

Browse files
committed
2 parents d5f0fbb + e16569a commit c989cdb

File tree

302 files changed

+5747
-3879
lines changed

Some content is hidden

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

302 files changed

+5747
-3879
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/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

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

+16-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repos:
3434
types_or: [python, rst, markdown]
3535
additional_dependencies: [tomli]
3636
- repo: https://github.com/MarcoGorelli/cython-lint
37-
rev: v0.9.1
37+
rev: v0.10.1
3838
hooks:
3939
- id: cython-lint
4040
- id: double-quote-cython-strings
@@ -63,7 +63,8 @@ repos:
6363
'--extensions=c,h',
6464
'--headers=h',
6565
--recursive,
66-
'--filter=-readability/casting,-runtime/int,-build/include_subdir'
66+
--linelength=88,
67+
'--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size'
6768
]
6869
- repo: https://github.com/PyCQA/flake8
6970
rev: 6.0.0
@@ -76,12 +77,12 @@ repos:
7677
- flake8-bugbear==22.7.1
7778
- pandas-dev-flaker==0.5.0
7879
- repo: https://github.com/pycqa/pylint
79-
rev: v2.15.6
80+
rev: v2.15.9
8081
hooks:
8182
- id: pylint
8283
stages: [manual]
8384
- repo: https://github.com/pycqa/pylint
84-
rev: v2.15.6
85+
rev: v2.15.9
8586
hooks:
8687
- id: pylint
8788
alias: redefined-outer-name
@@ -94,15 +95,14 @@ repos:
9495
|^pandas/util/_test_decorators\.py # keep excluded
9596
|^pandas/_version\.py # keep excluded
9697
|^pandas/conftest\.py # keep excluded
97-
|^pandas/core/generic\.py
9898
args: [--disable=all, --enable=redefined-outer-name]
9999
stages: [manual]
100100
- repo: https://github.com/PyCQA/isort
101-
rev: 5.10.1
101+
rev: 5.11.4
102102
hooks:
103103
- id: isort
104104
- repo: https://github.com/asottile/pyupgrade
105-
rev: v3.2.2
105+
rev: v3.3.1
106106
hooks:
107107
- id: pyupgrade
108108
args: [--py38-plus]
@@ -333,3 +333,12 @@ repos:
333333
additional_dependencies:
334334
- autotyping==22.9.0
335335
- 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()

asv_bench/benchmarks/reshape.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@
1515

1616

1717
class Melt:
18-
def setup(self):
19-
self.df = DataFrame(np.random.randn(10000, 3), columns=["A", "B", "C"])
20-
self.df["id1"] = np.random.randint(0, 10, 10000)
21-
self.df["id2"] = np.random.randint(100, 1000, 10000)
18+
params = ["float64", "Float64"]
19+
param_names = ["dtype"]
20+
21+
def setup(self, dtype):
22+
self.df = DataFrame(
23+
np.random.randn(100_000, 3), columns=["A", "B", "C"], dtype=dtype
24+
)
25+
self.df["id1"] = pd.Series(np.random.randint(0, 10, 10000))
26+
self.df["id2"] = pd.Series(np.random.randint(100, 1000, 10000))
2227

23-
def time_melt_dataframe(self):
28+
def time_melt_dataframe(self, dtype):
2429
melt(self.df, id_vars=["id1", "id2"])
2530

2631

ci/deps/actions-310-numpydev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ dependencies:
2222
- "cython"
2323
- "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple"
2424
- "--pre"
25-
- "numpy"
25+
- "numpy<1.24"
2626
- "scipy"

ci/deps/actions-310.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818

1919
# required dependencies
2020
- python-dateutil
21-
- numpy
21+
- numpy<1.24
2222
- pytz
2323

2424
# optional dependencies
@@ -42,7 +42,7 @@ dependencies:
4242
- psycopg2
4343
- pymysql
4444
- pytables
45-
- pyarrow<10
45+
- pyarrow
4646
- pyreadstat
4747
- python-snappy
4848
- pyxlsb

ci/deps/actions-38-downstream_compat.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919

2020
# required dependencies
2121
- python-dateutil
22-
- numpy
22+
- numpy<1.24
2323
- pytz
2424

2525
# optional dependencies
@@ -40,7 +40,7 @@ dependencies:
4040
- openpyxl
4141
- odfpy
4242
- psycopg2
43-
- pyarrow<10
43+
- pyarrow
4444
- pymysql
4545
- pyreadstat
4646
- pytables
@@ -56,7 +56,6 @@ dependencies:
5656
- zstandard
5757

5858
# downstream packages
59-
- aiobotocore
6059
- botocore
6160
- cftime
6261
- dask

0 commit comments

Comments
 (0)