Skip to content

Commit 6e72b91

Browse files
committed
Merge branch 'master' into 31793-timestamp-subtraction-bug
2 parents 498efcc + 93631a9 commit 6e72b91

File tree

201 files changed

+2236
-1428
lines changed

Some content is hidden

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

201 files changed

+2236
-1428
lines changed

.github/CONTRIBUTING.md

+1-21
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
11
# Contributing to pandas
22

3-
Whether you are a novice or experienced software developer, all contributions and suggestions are welcome!
4-
5-
Our main contributing guide can be found [in this repo](https://github.com/pandas-dev/pandas/blob/master/doc/source/development/contributing.rst) or [on the website](https://pandas.pydata.org/docs/dev/development/contributing.html). If you do not want to read it in its entirety, we will summarize the main ways in which you can contribute and point to relevant sections of that document for further information.
6-
7-
## Getting Started
8-
9-
If you are looking to contribute to the *pandas* codebase, the best place to start is the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues). This is also a great place for filing bug reports and making suggestions for ways in which we can improve the code and documentation.
10-
11-
If you have additional questions, feel free to ask them on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/pydata) or on [Gitter](https://gitter.im/pydata/pandas). Further information can also be found in the "[Where to start?](https://github.com/pandas-dev/pandas/blob/master/doc/source/development/contributing.rst#where-to-start)" section.
12-
13-
## Filing Issues
14-
15-
If you notice a bug in the code or documentation, or have suggestions for how we can improve either, feel free to create an issue on the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) using [GitHub's "issue" form](https://github.com/pandas-dev/pandas/issues/new). The form contains some questions that will help us best address your issue. For more information regarding how to file issues against *pandas*, please refer to the "[Bug reports and enhancement requests](https://github.com/pandas-dev/pandas/blob/master/doc/source/development/contributing.rst#bug-reports-and-enhancement-requests)" section.
16-
17-
## Contributing to the Codebase
18-
19-
The code is hosted on [GitHub](https://www.github.com/pandas-dev/pandas), so you will need to use [Git](https://git-scm.com/) to clone the project and make changes to the codebase. Once you have obtained a copy of the code, you should create a development environment that is separate from your existing Python environment so that you can make and test changes without compromising your own work environment. For more information, please refer to the "[Working with the code](https://github.com/pandas-dev/pandas/blob/master/doc/source/development/contributing.rst#working-with-the-code)" section.
20-
21-
Before submitting your changes for review, make sure to check that your changes do not break any tests. You can find more information about our test suites in the "[Test-driven development/code writing](https://github.com/pandas-dev/pandas/blob/master/doc/source/development/contributing.rst#test-driven-development-code-writing)" section. We also have guidelines regarding coding style that will be enforced during testing, which can be found in the "[Code standards](https://github.com/pandas-dev/pandas/blob/master/doc/source/development/contributing.rst#code-standards)" section.
22-
23-
Once your changes are ready to be submitted, make sure to push your changes to GitHub before creating a pull request. Details about how to do that can be found in the "[Contributing your changes to pandas](https://github.com/pandas-dev/pandas/blob/master/doc/source/development/contributing.rst#contributing-your-changes-to-pandas)" section. We will review your changes, and you will most likely be asked to make additional changes before it is finally ready to merge. However, once it's ready, we will merge it, and you will have successfully contributed to the codebase!
3+
A detailed overview on how to contribute can be found in the **[contributing guide](https://pandas.pydata.org/docs/dev/development/contributing.html)**.

.github/workflows/ci.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141

4242
- uses: conda-incubator/setup-miniconda@v2
4343
with:
44+
mamba-version: "*"
45+
channels: conda-forge
4446
activate-environment: pandas-dev
4547
channel-priority: strict
4648
environment-file: ${{ env.ENV_FILE }}
@@ -53,7 +55,7 @@ jobs:
5355

5456
- name: Install pyright
5557
# note: keep version in sync with .pre-commit-config.yaml
56-
run: npm install -g [email protected].171
58+
run: npm install -g [email protected].200
5759

5860
- name: Build Pandas
5961
uses: ./.github/actions/build_pandas
@@ -104,6 +106,8 @@ jobs:
104106

105107
- uses: conda-incubator/setup-miniconda@v2
106108
with:
109+
mamba-version: "*"
110+
channels: conda-forge
107111
activate-environment: pandas-dev
108112
channel-priority: strict
109113
environment-file: ${{ env.ENV_FILE }}

.github/workflows/database.yml

-121
This file was deleted.

.github/workflows/posix.yml

+32
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
strategy:
2626
matrix:
2727
settings: [
28+
[actions-38-db-min.yaml, "((not slow and not network and not clipboard) or (single and db))", "", "", "", "", ""],
29+
[actions-38-db.yaml, "((not slow and not network and not clipboard) or (single and db))", "", "", "", "", ""],
2830
[actions-38-minimum_versions.yaml, "not slow and not network and not clipboard", "", "", "", "", ""],
2931
[actions-38-locale_slow.yaml, "slow", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""],
3032
[actions-38.yaml, "not slow and not clipboard", "", "", "", "", ""],
@@ -52,7 +54,35 @@ jobs:
5254
# https://github.community/t/concurrecy-not-work-for-push/183068/7
5355
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}
5456
cancel-in-progress: true
57+
5558
services:
59+
mysql:
60+
image: mysql
61+
env:
62+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
63+
MYSQL_DATABASE: pandas
64+
options: >-
65+
--health-cmd "mysqladmin ping"
66+
--health-interval 10s
67+
--health-timeout 5s
68+
--health-retries 5
69+
ports:
70+
- 3306:3306
71+
72+
postgres:
73+
image: postgres
74+
env:
75+
POSTGRES_USER: postgres
76+
POSTGRES_PASSWORD: postgres
77+
POSTGRES_DB: pandas
78+
options: >-
79+
--health-cmd pg_isready
80+
--health-interval 10s
81+
--health-timeout 5s
82+
--health-retries 5
83+
ports:
84+
- 5432:5432
85+
5686
moto:
5787
image: motoserver/moto
5888
env:
@@ -81,6 +111,8 @@ jobs:
81111

82112
- uses: conda-incubator/setup-miniconda@v2
83113
with:
114+
mamba-version: "*"
115+
channels: conda-forge
84116
activate-environment: pandas-dev
85117
channel-priority: flexible
86118
environment-file: ${{ env.ENV_FILE }}

.github/workflows/python-dev.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ jobs:
4545
with:
4646
python-version: '3.10-dev'
4747

48+
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
4849
- name: Install dependencies
4950
shell: bash
5051
run: |
51-
python -m pip install --upgrade pip setuptools wheel
52+
python -m pip install --upgrade pip "setuptools<60.0.0" wheel
5253
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
5354
pip install git+https://github.com/nedbat/coveragepy.git
5455
pip install cython python-dateutil pytz hypothesis pytest>=6.2.5 pytest-xdist pytest-cov

.github/workflows/sdist.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ jobs:
3939
with:
4040
python-version: ${{ matrix.python-version }}
4141

42+
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
4243
- name: Install dependencies
4344
run: |
44-
python -m pip install --upgrade pip setuptools wheel
45+
python -m pip install --upgrade pip "setuptools<60.0.0" wheel
4546
4647
# GH 39416
4748
pip install numpy
@@ -57,8 +58,10 @@ jobs:
5758
channels: conda-forge
5859
python-version: '${{ matrix.python-version }}'
5960

61+
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
6062
- name: Install pandas from sdist
6163
run: |
64+
python -m pip install --upgrade "setuptools<60.0.0"
6265
pip list
6366
python -m pip install dist/*.gz
6467

.pre-commit-config.yaml

+5-15
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,15 @@ repos:
3535
# we can lint all header files since they aren't "generated" like C files are.
3636
exclude: ^pandas/_libs/src/(klib|headers)/
3737
args: [--quiet, '--extensions=c,h', '--headers=h', --recursive, '--filter=-readability/casting,-runtime/int,-build/include_subdir']
38-
- repo: https://gitlab.com/pycqa/flake8
39-
rev: 3.9.2
38+
- repo: https://github.com/PyCQA/flake8
39+
rev: 4.0.1
4040
hooks:
4141
- id: flake8
4242
additional_dependencies: &flake8_dependencies
43-
- flake8==3.9.2
44-
- flake8-comprehensions==3.1.0
43+
- flake8==4.0.1
44+
- flake8-comprehensions==3.7.0
4545
- flake8-bugbear==21.3.2
4646
- pandas-dev-flaker==0.2.0
47-
- id: flake8
48-
alias: flake8-cython
49-
name: flake8 (cython)
50-
types: [cython]
51-
args: [--append-config=flake8/cython.cfg]
52-
- id: flake8
53-
name: flake8 (cython template)
54-
files: \.pxi\.in$
55-
types: [text]
56-
args: [--append-config=flake8/cython-template.cfg]
5747
- repo: https://github.com/PyCQA/isort
5848
rev: 5.10.1
5949
hooks:
@@ -88,7 +78,7 @@ repos:
8878
types: [python]
8979
stages: [manual]
9080
# note: keep version in sync with .github/workflows/ci.yml
91-
additional_dependencies: ['[email protected].171']
81+
additional_dependencies: ['[email protected].200']
9282
- repo: local
9383
hooks:
9484
- id: flake8-rst

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ global-exclude *.xpt
3636
global-exclude *.cpt
3737
global-exclude *.xz
3838
global-exclude *.zip
39+
global-exclude *.zst
3940
global-exclude *~
4041
global-exclude .DS_Store
4142
global-exclude .git*

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Most development discussions take place on GitHub in this repo. Further, the [pa
160160

161161
All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.
162162

163-
A detailed overview on how to contribute can be found in the **[contributing guide](https://pandas.pydata.org/docs/dev/development/contributing.html)**. There is also an [overview](.github/CONTRIBUTING.md) on GitHub.
163+
A detailed overview on how to contribute can be found in the **[contributing guide](https://pandas.pydata.org/docs/dev/development/contributing.html)**.
164164

165165
If you are simply looking to start working with the pandas codebase, navigate to the [GitHub "issues" tab](https://github.com/pandas-dev/pandas/issues) and start looking through interesting issues. There are a number of issues listed under [Docs](https://github.com/pandas-dev/pandas/issues?labels=Docs&sort=updated&state=open) and [good first issue](https://github.com/pandas-dev/pandas/issues?labels=good+first+issue&sort=updated&state=open) where you could start out.
166166

asv_bench/benchmarks/frame_ctor.py

+17
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,21 @@ def time_frame_from_arrays_sparse(self):
182182
)
183183

184184

185+
class From3rdParty:
186+
# GH#44616
187+
188+
def setup(self):
189+
try:
190+
import torch
191+
except ImportError:
192+
raise NotImplementedError
193+
194+
row = 700000
195+
col = 64
196+
self.val_tensor = torch.randn(row, col)
197+
198+
def time_from_torch(self):
199+
DataFrame(self.val_tensor)
200+
201+
185202
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/sparse.py

+23-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ def time_take(self, indices, allow_fill):
198198
class GetItem:
199199
def setup(self):
200200
N = 1_000_000
201-
arr = make_array(N, 1e-5, np.nan, np.float64)
201+
d = 1e-5
202+
arr = make_array(N, d, np.nan, np.float64)
202203
self.sp_arr = SparseArray(arr)
203204

204205
def time_integer_indexing(self):
@@ -208,4 +209,25 @@ def time_slice(self):
208209
self.sp_arr[1:]
209210

210211

212+
class GetItemMask:
213+
214+
params = [True, False, np.nan]
215+
param_names = ["fill_value"]
216+
217+
def setup(self, fill_value):
218+
N = 1_000_000
219+
d = 1e-5
220+
arr = make_array(N, d, np.nan, np.float64)
221+
self.sp_arr = SparseArray(arr)
222+
b_arr = np.full(shape=N, fill_value=fill_value, dtype=np.bool8)
223+
fv_inds = np.unique(
224+
np.random.randint(low=0, high=N - 1, size=int(N * d), dtype=np.int32)
225+
)
226+
b_arr[fv_inds] = True if pd.isna(fill_value) else not fill_value
227+
self.sp_b_arr = SparseArray(b_arr, dtype=np.bool8, fill_value=fill_value)
228+
229+
def time_mask(self, fill_value):
230+
self.sp_arr[self.sp_b_arr]
231+
232+
211233
from .pandas_vb_common import setup # noqa: F401 isort:skip

azure-pipelines.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ jobs:
3636
vmImage: ubuntu-18.04
3737

3838
steps:
39+
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
3940
- script: |
4041
docker pull quay.io/pypa/manylinux2014_i686
4142
docker run -v $(pwd):/pandas quay.io/pypa/manylinux2014_i686 \
4243
/bin/bash -xc "cd pandas && \
4344
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \
4445
. ~/virtualenvs/pandas-dev/bin/activate && \
45-
python -m pip install --no-deps -U pip wheel setuptools && \
46+
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
4647
pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines && \
4748
python setup.py build_ext -q -j2 && \
4849
python -m pip install --no-build-isolation -e . && \

0 commit comments

Comments
 (0)