Skip to content

Commit edf0a81

Browse files
Merge remote-tracking branch 'upstream/master' into bisect
2 parents d390d32 + 4e2c588 commit edf0a81

File tree

254 files changed

+6731
-4241
lines changed

Some content is hidden

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

254 files changed

+6731
-4241
lines changed

.github/workflows/ci.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v1
25+
uses: actions/checkout@v2
26+
with:
27+
fetch-depth: 0
2628

2729
- name: Looking for unwanted patterns
2830
run: ci/code_checks.sh patterns
@@ -94,7 +96,9 @@ jobs:
9496
steps:
9597

9698
- name: Checkout
97-
uses: actions/checkout@v1
99+
uses: actions/checkout@v2
100+
with:
101+
fetch-depth: 0
98102

99103
- name: Set up pandas
100104
uses: ./.github/actions/setup
@@ -147,7 +151,9 @@ jobs:
147151
steps:
148152

149153
- name: Checkout
150-
uses: actions/checkout@v1
154+
uses: actions/checkout@v2
155+
with:
156+
fetch-depth: 0
151157

152158
- name: Set up pandas
153159
uses: ./.github/actions/setup

.github/workflows/database.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ jobs:
5656

5757
steps:
5858
- name: Checkout
59-
uses: actions/checkout@v1
59+
uses: actions/checkout@v2
60+
with:
61+
fetch-depth: 0
6062

6163
- name: Cache conda
62-
uses: actions/cache@v1
64+
uses: actions/cache@v2
6365
env:
6466
CACHE_NUMBER: 0
6567
with:
@@ -70,7 +72,7 @@ jobs:
7072
- uses: conda-incubator/setup-miniconda@v2
7173
with:
7274
activate-environment: pandas-dev
73-
channel-priority: strict
75+
channel-priority: flexible
7476
environment-file: ${{ matrix.ENV_FILE }}
7577
use-only-tar-bz2: true
7678

.github/workflows/posix.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ jobs:
4444

4545
steps:
4646
- name: Checkout
47-
uses: actions/checkout@v1
47+
uses: actions/checkout@v2
48+
with:
49+
fetch-depth: 0
4850

4951
- name: Cache conda
50-
uses: actions/cache@v1
52+
uses: actions/cache@v2
5153
env:
5254
CACHE_NUMBER: 0
5355
with:

.pre-commit-config.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ repos:
2121
- repo: https://github.com/pre-commit/pre-commit-hooks
2222
rev: v3.4.0
2323
hooks:
24+
- id: debug-statements
2425
- id: end-of-file-fixer
2526
exclude: \.txt$
2627
- id: trailing-whitespace
@@ -35,7 +36,7 @@ repos:
3536
exclude: ^pandas/_libs/src/(klib|headers)/
3637
args: [--quiet, '--extensions=c,h', '--headers=h', --recursive, '--filter=-readability/casting,-runtime/int,-build/include_subdir']
3738
- repo: https://gitlab.com/pycqa/flake8
38-
rev: 3.9.1
39+
rev: 3.9.2
3940
hooks:
4041
- id: flake8
4142
additional_dependencies:
@@ -75,7 +76,7 @@ repos:
7576
hooks:
7677
- id: yesqa
7778
additional_dependencies:
78-
- flake8==3.9.1
79+
- flake8==3.9.2
7980
- flake8-comprehensions==3.1.0
8081
- flake8-bugbear==21.3.2
8182
- pandas-dev-flaker==0.2.0

asv_bench/benchmarks/io/style.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ def setup(self, cols, rows):
2020

2121
def time_apply_render(self, cols, rows):
2222
self._style_apply()
23-
self.st._render_html()
23+
self.st._render_html(True, True)
2424

2525
def peakmem_apply_render(self, cols, rows):
2626
self._style_apply()
27-
self.st._render_html()
27+
self.st._render_html(True, True)
2828

2929
def time_classes_render(self, cols, rows):
3030
self._style_classes()
31-
self.st._render_html()
31+
self.st._render_html(True, True)
3232

3333
def peakmem_classes_render(self, cols, rows):
3434
self._style_classes()
35-
self.st._render_html()
35+
self.st._render_html(True, True)
3636

3737
def time_format_render(self, cols, rows):
3838
self._style_format()

asv_bench/benchmarks/strings.py

+52-31
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@
1111
from .pandas_vb_common import tm
1212

1313

14+
class Dtypes:
15+
params = ["str", "string", "arrow_string"]
16+
param_names = ["dtype"]
17+
18+
def setup(self, dtype):
19+
from pandas.core.arrays.string_arrow import ArrowStringDtype # noqa: F401
20+
21+
try:
22+
self.s = Series(tm.makeStringIndex(10 ** 5), dtype=dtype)
23+
except ImportError:
24+
raise NotImplementedError
25+
26+
1427
class Construction:
1528

1629
params = ["str", "string"]
@@ -49,18 +62,7 @@ def peakmem_cat_frame_construction(self, dtype):
4962
DataFrame(self.frame_cat_arr, dtype=dtype)
5063

5164

52-
class Methods:
53-
params = ["str", "string", "arrow_string"]
54-
param_names = ["dtype"]
55-
56-
def setup(self, dtype):
57-
from pandas.core.arrays.string_arrow import ArrowStringDtype # noqa: F401
58-
59-
try:
60-
self.s = Series(tm.makeStringIndex(10 ** 5), dtype=dtype)
61-
except ImportError:
62-
raise NotImplementedError
63-
65+
class Methods(Dtypes):
6466
def time_center(self, dtype):
6567
self.s.str.center(100)
6668

@@ -83,6 +85,9 @@ def time_find(self, dtype):
8385
def time_rfind(self, dtype):
8486
self.s.str.rfind("[A-Z]+")
8587

88+
def time_fullmatch(self, dtype):
89+
self.s.str.fullmatch("A")
90+
8691
def time_get(self, dtype):
8792
self.s.str.get(0)
8893

@@ -211,43 +216,53 @@ def time_cat(self, other_cols, sep, na_rep, na_frac):
211216
self.s.str.cat(others=self.others, sep=sep, na_rep=na_rep)
212217

213218

214-
class Contains:
219+
class Contains(Dtypes):
215220

216-
params = (["str", "string", "arrow_string"], [True, False])
221+
params = (Dtypes.params, [True, False])
217222
param_names = ["dtype", "regex"]
218223

219224
def setup(self, dtype, regex):
220-
from pandas.core.arrays.string_arrow import ArrowStringDtype # noqa: F401
221-
222-
try:
223-
self.s = Series(tm.makeStringIndex(10 ** 5), dtype=dtype)
224-
except ImportError:
225-
raise NotImplementedError
225+
super().setup(dtype)
226226

227227
def time_contains(self, dtype, regex):
228228
self.s.str.contains("A", regex=regex)
229229

230230

231-
class Split:
231+
class Split(Dtypes):
232232

233-
params = [True, False]
234-
param_names = ["expand"]
233+
params = (Dtypes.params, [True, False])
234+
param_names = ["dtype", "expand"]
235235

236-
def setup(self, expand):
237-
self.s = Series(tm.makeStringIndex(10 ** 5)).str.join("--")
236+
def setup(self, dtype, expand):
237+
super().setup(dtype)
238+
self.s = self.s.str.join("--")
238239

239-
def time_split(self, expand):
240+
def time_split(self, dtype, expand):
240241
self.s.str.split("--", expand=expand)
241242

242-
def time_rsplit(self, expand):
243+
def time_rsplit(self, dtype, expand):
243244
self.s.str.rsplit("--", expand=expand)
244245

245246

246-
class Dummies:
247-
def setup(self):
248-
self.s = Series(tm.makeStringIndex(10 ** 5)).str.join("|")
247+
class Extract(Dtypes):
248+
249+
params = (Dtypes.params, [True, False])
250+
param_names = ["dtype", "expand"]
251+
252+
def setup(self, dtype, expand):
253+
super().setup(dtype)
254+
255+
def time_extract_single_group(self, dtype, expand):
256+
with warnings.catch_warnings(record=True):
257+
self.s.str.extract("(\\w*)A", expand=expand)
249258

250-
def time_get_dummies(self):
259+
260+
class Dummies(Dtypes):
261+
def setup(self, dtype):
262+
super().setup(dtype)
263+
self.s = self.s.str.join("|")
264+
265+
def time_get_dummies(self, dtype):
251266
self.s.str.get_dummies("|")
252267

253268

@@ -266,3 +281,9 @@ def setup(self):
266281
def time_vector_slice(self):
267282
# GH 2602
268283
self.s.str[:5]
284+
285+
286+
class Iter(Dtypes):
287+
def time_iter(self, dtype):
288+
for i in self.s:
289+
pass

ci/deps/actions-37-db-min.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ dependencies:
3131
- openpyxl
3232
- pandas-gbq
3333
- google-cloud-bigquery>=1.27.2 # GH 36436
34-
- pyarrow=0.17 # GH 38803
34+
- protobuf>=3.12.4
35+
- pyarrow=0.17.1 # GH 38803
3536
- pytables>=3.5.1
3637
- scipy
3738
- xarray=0.12.3

ci/deps/actions-37-db.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
- beautifulsoup4
1616
- botocore>=1.11
1717
- dask
18-
- fastparquet>=0.4.0, <=0.5.0
18+
- fastparquet>=0.4.0
1919
- fsspec>=0.7.4
2020
- gcsfs>=0.6.0
2121
- geopandas
@@ -31,7 +31,7 @@ dependencies:
3131
- pandas-gbq
3232
- google-cloud-bigquery>=1.27.2 # GH 36436
3333
- psycopg2
34-
- pyarrow>=0.15.0
34+
- pyarrow>=0.17.0
3535
- pymysql
3636
- pytables
3737
- python-snappy

ci/deps/actions-37-minimum_versions.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ dependencies:
1717
- bottleneck=1.2.1
1818
- jinja2=2.10
1919
- numba=0.46.0
20-
- numexpr=2.6.8
20+
- numexpr=2.7.0
2121
- numpy=1.17.3
2222
- openpyxl=3.0.0
2323
- pytables=3.5.1
2424
- python-dateutil=2.7.3
2525
- pytz=2017.3
26-
- pyarrow=0.15
26+
- pyarrow=0.17.0
2727
- scipy=1.2
2828
- xlrd=1.2.0
2929
- xlsxwriter=1.0.2

ci/deps/actions-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- numpy=1.19
1919
- python-dateutil
2020
- nomkl
21-
- pyarrow=0.15.1
21+
- pyarrow
2222
- pytz
2323
- s3fs>=0.4.0
2424
- moto>=1.3.14

ci/deps/azure-macos-37.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: pandas-dev
22
channels:
33
- defaults
4+
- conda-forge
45
dependencies:
56
- python=3.7.*
67

@@ -21,7 +22,7 @@ dependencies:
2122
- numexpr
2223
- numpy=1.17.3
2324
- openpyxl
24-
- pyarrow=0.15.1
25+
- pyarrow=0.17.0
2526
- pytables
2627
- python-dateutil==2.7.3
2728
- pytz

ci/deps/azure-windows-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies:
2626
- numexpr
2727
- numpy=1.17.*
2828
- openpyxl
29-
- pyarrow=0.15
29+
- pyarrow=0.17.0
3030
- pytables
3131
- python-dateutil
3232
- pytz

ci/deps/azure-windows-38.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
# pandas dependencies
1616
- blosc
1717
- bottleneck
18-
- fastparquet>=0.4.0, <=0.5.0
18+
- fastparquet>=0.4.0
1919
- flask
2020
- fsspec>=0.8.0
2121
- matplotlib=3.1.3
@@ -25,7 +25,7 @@ dependencies:
2525
- numpy=1.18.*
2626
- openpyxl
2727
- jinja2
28-
- pyarrow>=0.15.0
28+
- pyarrow>=0.17.0
2929
- pytables
3030
- python-dateutil
3131
- pytz

ci/run_tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile $TE
2424
if [[ $(uname) != "Linux" && $(uname) != "Darwin" ]]; then
2525
# GH#37455 windows py38 build appears to be running out of memory
2626
# skip collection of window tests
27-
PYTEST_CMD="$PYTEST_CMD --ignore=pandas/tests/window/ --ignore=pandas/tests/plotting/"
27+
PYTEST_CMD="$PYTEST_CMD --ignore=pandas/tests/window/moments --ignore=pandas/tests/plotting/"
2828
fi
2929

3030
echo $PYTEST_CMD

doc/redirects.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,7 @@ generated/pandas.Series.str.extractall,../reference/api/pandas.Series.str.extrac
11971197
generated/pandas.Series.str.extract,../reference/api/pandas.Series.str.extract
11981198
generated/pandas.Series.str.findall,../reference/api/pandas.Series.str.findall
11991199
generated/pandas.Series.str.find,../reference/api/pandas.Series.str.find
1200+
generated/pandas.Series.str.fullmatch,../reference/api/pandas.Series.str.fullmatch
12001201
generated/pandas.Series.str.get_dummies,../reference/api/pandas.Series.str.get_dummies
12011202
generated/pandas.Series.str.get,../reference/api/pandas.Series.str.get
12021203
generated/pandas.Series.str,../reference/api/pandas.Series.str

doc/source/development/code_style.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ xfail during the testing phase. To do so, use the ``request`` fixture:
5757
import pytest
5858
5959
def test_xfail(request):
60-
request.node.add_marker(pytest.mark.xfail(reason="Indicate why here"))
60+
mark = pytest.mark.xfail(raises=TypeError, reason="Indicate why here")
61+
request.node.add_marker(mark)
6162
6263
xfail is not to be used for tests involving failure due to invalid user arguments.
6364
For these tests, we need to verify the correct exception type and error message

0 commit comments

Comments
 (0)