Skip to content

Commit 59c0043

Browse files
authored
Merge branch 'master' into dev23122
2 parents 6566435 + d228a78 commit 59c0043

File tree

266 files changed

+6377
-4280
lines changed

Some content is hidden

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

266 files changed

+6377
-4280
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ body:
77
- type: checkboxes
88
id: checks
99
attributes:
10+
label: Pandas version checks
1011
options:
1112
- label: >
1213
I have checked that this issue has not already been reported.

.github/ISSUE_TEMPLATE/documentation_improvement.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ labels: [Docs, Needs Triage]
66
body:
77
- type: checkboxes
88
attributes:
9+
label: Pandas version checks
910
options:
1011
- label: >
1112
I have checked that the issue still exists on the latest versions of the docs

.github/ISSUE_TEMPLATE/installation_issue.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ body:
77
- type: checkboxes
88
id: checks
99
attributes:
10+
label: Installation check
1011
options:
1112
- label: >
1213
I have read the [installation guide](https://pandas.pydata.org/pandas-docs/stable/getting_started/install.html#installing-pandas).

.github/ISSUE_TEMPLATE/performance_issue.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ body:
77
- type: checkboxes
88
id: checks
99
attributes:
10+
label: Pandas version checks
1011
options:
1112
- label: >
1213
I have checked that this issue has not already been reported.

.github/ISSUE_TEMPLATE/submit_question.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ body:
1111
usage questions, we ask that all usage questions are first asked on StackOverflow.
1212
- type: checkboxes
1313
attributes:
14+
label: Research
1415
options:
1516
- label: >
1617
I have searched the [[pandas] tag](https://stackoverflow.com/questions/tagged/pandas)

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,40 @@ jobs:
7878
run: pytest scripts
7979
if: always()
8080

81+
benchmarks:
82+
name: Benchmarks
83+
runs-on: ubuntu-latest
84+
defaults:
85+
run:
86+
shell: bash -l {0}
87+
88+
concurrency:
89+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
90+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-benchmarks
91+
cancel-in-progress: true
92+
93+
steps:
94+
- name: Checkout
95+
uses: actions/checkout@v2
96+
with:
97+
fetch-depth: 0
98+
99+
- name: Cache conda
100+
uses: actions/cache@v2
101+
with:
102+
path: ~/conda_pkgs_dir
103+
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
104+
105+
- uses: conda-incubator/setup-miniconda@v2
106+
with:
107+
activate-environment: pandas-dev
108+
channel-priority: strict
109+
environment-file: ${{ env.ENV_FILE }}
110+
use-only-tar-bz2: true
111+
112+
- name: Build Pandas
113+
uses: ./.github/actions/build_pandas
114+
81115
- name: Running benchmarks
82116
run: |
83117
cd asv_bench

.github/workflows/posix.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
[actions-38-slow.yaml, "slow", "", "", "", "", ""],
3232
[actions-38-locale.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""],
3333
[actions-39-slow.yaml, "slow", "", "", "", "", ""],
34+
[actions-pypy-38.yaml, "not slow and not clipboard", "", "", "", "", "--max-worker-restart 0"],
3435
[actions-39-numpydev.yaml, "not slow and not network", "xsel", "", "", "deprecate", "-W error"],
3536
[actions-39.yaml, "not slow and not clipboard", "", "", "", "", ""]
3637
]
3738
fail-fast: false
3839
env:
39-
COVERAGE: true
4040
ENV_FILE: ci/deps/${{ matrix.settings[0] }}
4141
PATTERN: ${{ matrix.settings[1] }}
4242
EXTRA_APT: ${{ matrix.settings[2] }}
@@ -45,6 +45,9 @@ jobs:
4545
PANDAS_TESTING_MODE: ${{ matrix.settings[5] }}
4646
TEST_ARGS: ${{ matrix.settings[6] }}
4747
PYTEST_TARGET: pandas
48+
IS_PYPY: ${{ contains(matrix.settings[0], 'pypy') }}
49+
# TODO: re-enable coverage on pypy, its slow
50+
COVERAGE: ${{ !contains(matrix.settings[0], 'pypy') }}
4851
concurrency:
4952
# https://github.community/t/concurrecy-not-work-for-push/183068/7
5053
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}
@@ -82,12 +85,29 @@ jobs:
8285
channel-priority: flexible
8386
environment-file: ${{ env.ENV_FILE }}
8487
use-only-tar-bz2: true
88+
if: ${{ env.IS_PYPY == 'false' }} # No pypy3.8 support
89+
90+
- name: Setup PyPy
91+
uses: actions/[email protected]
92+
with:
93+
python-version: "pypy-3.8"
94+
if: ${{ env.IS_PYPY == 'true' }}
95+
96+
- name: Setup PyPy dependencies
97+
shell: bash
98+
run: |
99+
# TODO: re-enable cov, its slowing the tests down though
100+
# TODO: Unpin Cython, the new Cython 0.29.26 is causing compilation errors
101+
pip install Cython==0.29.25 numpy python-dateutil pytz pytest>=6.0 pytest-xdist>=1.31.0 hypothesis>=5.5.3
102+
if: ${{ env.IS_PYPY == 'true' }}
85103

86104
- name: Build Pandas
87105
uses: ./.github/actions/build_pandas
88106

89107
- name: Test
90108
run: ci/run_tests.sh
109+
# TODO: Don't continue on error for PyPy
110+
continue-on-error: ${{ env.IS_PYPY == 'true' }}
91111
if: always()
92112

93113
- name: Build Version

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ dist
5050
*.egg-info
5151
.eggs
5252
.pypirc
53+
# type checkers
54+
pandas/py.typed
5355

5456
# tox testing tool
5557
.tox

asv_bench/benchmarks/arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def setup(self, op, shape):
144144
# should already be the case, but just to be sure
145145
df._consolidate_inplace()
146146

147-
# TODO: GH#33198 the setting here shoudlnt need two steps
147+
# TODO: GH#33198 the setting here shouldn't need two steps
148148
arr1 = np.random.randn(n_rows, max(n_cols // 4, 3)).astype("f8")
149149
arr2 = np.random.randn(n_rows, n_cols // 2).astype("i8")
150150
arr3 = np.random.randn(n_rows, n_cols // 4).astype("f8")

asv_bench/benchmarks/io/csv.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,26 @@ def time_frame(self, kind):
5555
self.df.to_csv(self.fname)
5656

5757

58+
class ToCSVMultiIndexUnusedLevels(BaseIO):
59+
60+
fname = "__test__.csv"
61+
62+
def setup(self):
63+
df = DataFrame({"a": np.random.randn(100_000), "b": 1, "c": 1})
64+
self.df = df.set_index(["a", "b"])
65+
self.df_unused_levels = self.df.iloc[:10_000]
66+
self.df_single_index = df.set_index(["a"]).iloc[:10_000]
67+
68+
def time_full_frame(self):
69+
self.df.to_csv(self.fname)
70+
71+
def time_sliced_frame(self):
72+
self.df_unused_levels.to_csv(self.fname)
73+
74+
def time_single_index_frame(self):
75+
self.df_single_index.to_csv(self.fname)
76+
77+
5878
class ToCSVDatetime(BaseIO):
5979

6080
fname = "__test__.csv"
@@ -67,6 +87,21 @@ def time_frame_date_formatting(self):
6787
self.data.to_csv(self.fname, date_format="%Y%m%d")
6888

6989

90+
class ToCSVDatetimeIndex(BaseIO):
91+
92+
fname = "__test__.csv"
93+
94+
def setup(self):
95+
rng = date_range("2000", periods=100_000, freq="S")
96+
self.data = DataFrame({"a": 1}, index=rng)
97+
98+
def time_frame_date_formatting_index(self):
99+
self.data.to_csv(self.fname, date_format="%Y-%m-%d %H:%M:%S")
100+
101+
def time_frame_date_no_format_index(self):
102+
self.data.to_csv(self.fname)
103+
104+
70105
class ToCSVDatetimeBig(BaseIO):
71106

72107
fname = "__test__.csv"

0 commit comments

Comments
 (0)