Skip to content

Commit e141123

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pr43154
2 parents 08b2429 + 4a2e467 commit e141123

File tree

215 files changed

+4260
-1433
lines changed

Some content is hidden

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

215 files changed

+4260
-1433
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-39
This file was deleted.
+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Bug Report
2+
description: Report incorrect behavior in the pandas library
3+
title: "BUG: "
4+
labels: [Bug, Needs Triage]
5+
6+
body:
7+
- type: checkboxes
8+
id: checks
9+
attributes:
10+
options:
11+
- label: >
12+
I have checked that this issue has not already been reported.
13+
required: true
14+
- label: >
15+
I have confirmed this bug exists on the
16+
[latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
17+
required: true
18+
- label: >
19+
I have confirmed this bug exists on the master branch of pandas.
20+
- type: textarea
21+
id: example
22+
attributes:
23+
label: Reproducible Example
24+
description: >
25+
Please follow [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) on how to
26+
provide a minimal, copy-pastable example.
27+
placeholder: >
28+
import pandas as pd
29+
30+
df = pd.DataFrame(range(5))
31+
32+
...
33+
render: python
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: problem
38+
attributes:
39+
label: Issue Description
40+
description: >
41+
Please provide a description of the issue shown in the reproducible example.
42+
validations:
43+
required: true
44+
- type: textarea
45+
id: expected-behavior
46+
attributes:
47+
label: Expected Behavior
48+
description: >
49+
Please describe or show a code example of the expected behavior.
50+
validations:
51+
required: true
52+
- type: textarea
53+
id: version
54+
attributes:
55+
label: Installed Versions
56+
description: >
57+
Please paste the output of ``pd.show_versions()``
58+
value: >
59+
<details>
60+
61+
62+
Replace this line with the output of pd.show_versions()
63+
64+
65+
</details>
66+
validations:
67+
required: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Installation Issue
2+
description: Report issues installing the pandas library on your system
3+
title: "BUILD: "
4+
labels: [Build, Needs Triage]
5+
6+
body:
7+
- type: checkboxes
8+
id: checks
9+
attributes:
10+
options:
11+
- label: >
12+
I have read the [installation guide](https://pandas.pydata.org/pandas-docs/stable/getting_started/install.html#installing-pandas).
13+
required: true
14+
- type: input
15+
id: platform
16+
attributes:
17+
label: Platform
18+
description: >
19+
Please provide the output of ``import platform; print(platform.platform())``
20+
validations:
21+
required: true
22+
- type: dropdown
23+
id: method
24+
attributes:
25+
label: Installation Method
26+
description: >
27+
Please provide how you tried to install pandas from a clean environment.
28+
options:
29+
- pip install
30+
- conda install
31+
- apt-get install
32+
- Built from source
33+
- Other
34+
validations:
35+
required: true
36+
- type: input
37+
id: pandas
38+
attributes:
39+
label: pandas Version
40+
description: >
41+
Please provide the version of pandas you are trying to install.
42+
validations:
43+
required: true
44+
- type: input
45+
id: python
46+
attributes:
47+
label: Python Version
48+
description: >
49+
Please provide the installed version of Python.
50+
validations:
51+
required: true
52+
- type: textarea
53+
id: logs
54+
attributes:
55+
label: Installation Logs
56+
description: >
57+
If possible, please copy and paste the installation logs when attempting to install pandas.
58+
value: >
59+
<details>
60+
61+
62+
Replace this line with the installation logs.
63+
64+
65+
</details>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Performance Issue
2+
description: Report slow performance or memory issues when running pandas code
3+
title: "PERF: "
4+
labels: [Performance, Needs Triage]
5+
6+
body:
7+
- type: checkboxes
8+
id: checks
9+
attributes:
10+
options:
11+
- label: >
12+
I have checked that this issue has not already been reported.
13+
required: true
14+
- label: >
15+
I have confirmed this issue exists on the
16+
[latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
17+
required: true
18+
- label: >
19+
I have confirmed this issue exists on the master branch of pandas.
20+
- type: textarea
21+
id: example
22+
attributes:
23+
label: Reproducible Example
24+
description: >
25+
Please provide a minimal, copy-pastable example that quantifies
26+
[slow runtime](https://docs.python.org/3/library/timeit.html) or
27+
[memory](https://pypi.org/project/memory-profiler/) issues.
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: version
32+
attributes:
33+
label: Installed Versions
34+
description: >
35+
Please paste the output of ``pd.show_versions()``
36+
value: >
37+
<details>
38+
39+
40+
Replace this line with the output of pd.show_versions()
41+
42+
43+
</details>
44+
validations:
45+
required: true
46+
- type: textarea
47+
id: prior-performance
48+
attributes:
49+
label: Prior Performance
50+
description: >
51+
If applicable, please provide the prior version of pandas and output
52+
of the same reproducible example where the performance issue did not exist.

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
- [ ] closes #xxxx
22
- [ ] tests added / passed
3-
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
3+
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
44
- [ ] whatsnew entry

.github/workflows/asv-bot.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: "ASV Bot"
2+
3+
on:
4+
issue_comment: # Pull requests are issues
5+
types:
6+
- created
7+
8+
env:
9+
ENV_FILE: environment.yml
10+
COMMENT: ${{github.event.comment.body}}
11+
12+
jobs:
13+
autotune:
14+
name: "Run benchmarks"
15+
# TODO: Support more benchmarking options later, against different branches, against self, etc
16+
if: startsWith(github.event.comment.body, '@github-actions benchmark')
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
shell: bash -l {0}
21+
22+
concurrency:
23+
# Set concurrency to prevent abuse(full runs are ~5.5 hours !!!)
24+
# each user can only run one concurrent benchmark bot at a time
25+
# We don't cancel in progress jobs, but if you want to benchmark multiple PRs, you're gonna have
26+
# to wait
27+
group: ${{ github.actor }}-asv
28+
cancel-in-progress: false
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v2
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Cache conda
37+
uses: actions/cache@v2
38+
with:
39+
path: ~/conda_pkgs_dir
40+
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
41+
42+
# Although asv sets up its own env, deps are still needed
43+
# during discovery process
44+
- uses: conda-incubator/setup-miniconda@v2
45+
with:
46+
activate-environment: pandas-dev
47+
channel-priority: strict
48+
environment-file: ${{ env.ENV_FILE }}
49+
use-only-tar-bz2: true
50+
51+
- name: Run benchmarks
52+
id: bench
53+
continue-on-error: true # This is a fake failure, asv will exit code 1 for regressions
54+
run: |
55+
# extracting the regex, see https://stackoverflow.com/a/36798723
56+
REGEX=$(echo "$COMMENT" | sed -n "s/^.*-b\s*\(\S*\).*$/\1/p")
57+
cd asv_bench
58+
asv check -E existing
59+
git remote add upstream https://github.com/pandas-dev/pandas.git
60+
git fetch upstream
61+
asv machine --yes
62+
asv continuous -f 1.1 -b $REGEX upstream/master HEAD
63+
echo 'BENCH_OUTPUT<<EOF' >> $GITHUB_ENV
64+
asv compare -f 1.1 upstream/master HEAD >> $GITHUB_ENV
65+
echo 'EOF' >> $GITHUB_ENV
66+
echo "REGEX=$REGEX" >> $GITHUB_ENV
67+
68+
- uses: actions/github-script@v4
69+
env:
70+
BENCH_OUTPUT: ${{env.BENCH_OUTPUT}}
71+
REGEX: ${{env.REGEX}}
72+
with:
73+
script: |
74+
const ENV_VARS = process.env
75+
const run_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
76+
github.issues.createComment({
77+
issue_number: context.issue.number,
78+
owner: context.repo.owner,
79+
repo: context.repo.repo,
80+
body: '\nBenchmarks completed. View runner logs here.' + run_url + '\nRegex used: '+ 'regex ' + ENV_VARS["REGEX"] + '\n' + ENV_VARS["BENCH_OUTPUT"]
81+
})

.github/workflows/autoupdate-pre-commit-config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "Update pre-commit config"
22

33
on:
44
schedule:
5-
- cron: "0 7 * * 1" # At 07:00 on each Monday.
5+
- cron: "0 7 1 * *" # At 07:00 on 1st of every month.
66
workflow_dispatch:
77

88
jobs:

asv_bench/benchmarks/dtypes.py

+20-9
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,26 @@ def time_pandas_dtype_invalid(self, dtype):
5050

5151
class SelectDtypes:
5252

53-
params = [
54-
tm.ALL_INT_NUMPY_DTYPES
55-
+ tm.ALL_INT_EA_DTYPES
56-
+ tm.FLOAT_NUMPY_DTYPES
57-
+ tm.COMPLEX_DTYPES
58-
+ tm.DATETIME64_DTYPES
59-
+ tm.TIMEDELTA64_DTYPES
60-
+ tm.BOOL_DTYPES
61-
]
53+
try:
54+
params = [
55+
tm.ALL_INT_NUMPY_DTYPES
56+
+ tm.ALL_INT_EA_DTYPES
57+
+ tm.FLOAT_NUMPY_DTYPES
58+
+ tm.COMPLEX_DTYPES
59+
+ tm.DATETIME64_DTYPES
60+
+ tm.TIMEDELTA64_DTYPES
61+
+ tm.BOOL_DTYPES
62+
]
63+
except AttributeError:
64+
params = [
65+
tm.ALL_INT_DTYPES
66+
+ tm.ALL_EA_INT_DTYPES
67+
+ tm.FLOAT_DTYPES
68+
+ tm.COMPLEX_DTYPES
69+
+ tm.DATETIME64_DTYPES
70+
+ tm.TIMEDELTA64_DTYPES
71+
+ tm.BOOL_DTYPES
72+
]
6273
param_names = ["dtype"]
6374

6475
def setup(self, dtype):

asv_bench/benchmarks/indexing.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,14 @@ class ChainIndexing:
399399

400400
def setup(self, mode):
401401
self.N = 1000000
402+
self.df = DataFrame({"A": np.arange(self.N), "B": "foo"})
402403

403404
def time_chained_indexing(self, mode):
405+
df = self.df
406+
N = self.N
404407
with warnings.catch_warnings(record=True):
405408
with option_context("mode.chained_assignment", mode):
406-
df = DataFrame({"A": np.arange(self.N), "B": "foo"})
407-
df2 = df[df.A > self.N // 2]
409+
df2 = df[df.A > N // 2]
408410
df2["C"] = 1.0
409411

410412

0 commit comments

Comments
 (0)