Skip to content

Commit bb032ea

Browse files
committed
Merge remote-tracking branch 'upstream/master' into apply_output_cleanup
2 parents 0e16de3 + 542b20a commit bb032ea

File tree

172 files changed

+2997
-1398
lines changed

Some content is hidden

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

172 files changed

+2997
-1398
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ matrix:
4545
- JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard)"
4646

4747
- env:
48-
- JOB="3.6, locale" ENV_FILE="ci/deps/travis-36-locale.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
48+
- JOB="3.7, locale" ENV_FILE="ci/deps/travis-37-locale.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" LOCALE_OVERRIDE="zh_CN.UTF-8" SQL="1"
4949
services:
5050
- mysql
5151
- postgresql
@@ -54,7 +54,7 @@ matrix:
5454
# Enabling Deprecations when running tests
5555
# PANDAS_TESTING_MODE="deprecate" causes DeprecationWarning messages to be displayed in the logs
5656
# See pandas/_testing.py for more details.
57-
- JOB="3.6, coverage" ENV_FILE="ci/deps/travis-36-cov.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true SQL="1"
57+
- JOB="3.7, coverage" ENV_FILE="ci/deps/travis-37-cov.yaml" PATTERN="((not slow and not network and not clipboard) or (single and db))" PANDAS_TESTING_MODE="deprecate" COVERAGE=true SQL="1"
5858
services:
5959
- mysql
6060
- postgresql

asv_bench/benchmarks/index_object.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def time_datetime_difference_disjoint(self):
5757

5858
class Range:
5959
def setup(self):
60-
self.idx_inc = RangeIndex(start=0, stop=10 ** 7, step=3)
61-
self.idx_dec = RangeIndex(start=10 ** 7, stop=-1, step=-3)
60+
self.idx_inc = RangeIndex(start=0, stop=10 ** 6, step=3)
61+
self.idx_dec = RangeIndex(start=10 ** 6, stop=-1, step=-3)
6262

6363
def time_max(self):
6464
self.idx_inc.max()
@@ -73,15 +73,23 @@ def time_min_trivial(self):
7373
self.idx_inc.min()
7474

7575
def time_get_loc_inc(self):
76-
self.idx_inc.get_loc(900000)
76+
self.idx_inc.get_loc(900_000)
7777

7878
def time_get_loc_dec(self):
79-
self.idx_dec.get_loc(100000)
79+
self.idx_dec.get_loc(100_000)
80+
81+
def time_iter_inc(self):
82+
for _ in self.idx_inc:
83+
pass
84+
85+
def time_iter_dec(self):
86+
for _ in self.idx_dec:
87+
pass
8088

8189

8290
class IndexEquals:
8391
def setup(self):
84-
idx_large_fast = RangeIndex(100000)
92+
idx_large_fast = RangeIndex(100_000)
8593
idx_small_slow = date_range(start="1/1/2012", periods=1)
8694
self.mi_large_slow = MultiIndex.from_product([idx_large_fast, idx_small_slow])
8795

@@ -94,7 +102,7 @@ def time_non_object_equals_multiindex(self):
94102
class IndexAppend:
95103
def setup(self):
96104

97-
N = 10000
105+
N = 10_000
98106
self.range_idx = RangeIndex(0, 100)
99107
self.int_idx = self.range_idx.astype(int)
100108
self.obj_idx = self.int_idx.astype(str)
@@ -168,7 +176,7 @@ def time_get_loc_non_unique_sorted(self, dtype):
168176
class Float64IndexMethod:
169177
# GH 13166
170178
def setup(self):
171-
N = 100000
179+
N = 100_000
172180
a = np.arange(N)
173181
self.ind = Float64Index(a * 4.8000000418824129e-08)
174182

@@ -212,7 +220,7 @@ class GC:
212220
params = [1, 2, 5]
213221

214222
def create_use_drop(self):
215-
idx = Index(list(range(1000 * 1000)))
223+
idx = Index(list(range(1_000_000)))
216224
idx._engine
217225

218226
def peakmem_gc_instances(self, N):

asv_bench/benchmarks/package.py

+9-15
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,16 @@
44
import subprocess
55
import sys
66

7-
from pandas.compat import PY37
8-
97

108
class TimeImport:
119
def time_import(self):
12-
if PY37:
13-
# on py37+ we the "-X importtime" usage gives us a more precise
14-
# measurement of the import time we actually care about,
15-
# without the subprocess or interpreter overhead
16-
cmd = [sys.executable, "-X", "importtime", "-c", "import pandas as pd"]
17-
p = subprocess.run(cmd, stderr=subprocess.PIPE)
18-
19-
line = p.stderr.splitlines()[-1]
20-
field = line.split(b"|")[-2].strip()
21-
total = int(field) # microseconds
22-
return total
10+
# on py37+ we the "-X importtime" usage gives us a more precise
11+
# measurement of the import time we actually care about,
12+
# without the subprocess or interpreter overhead
13+
cmd = [sys.executable, "-X", "importtime", "-c", "import pandas as pd"]
14+
p = subprocess.run(cmd, stderr=subprocess.PIPE)
2315

24-
cmd = [sys.executable, "-c", "import pandas as pd"]
25-
subprocess.run(cmd, stderr=subprocess.PIPE)
16+
line = p.stderr.splitlines()[-1]
17+
field = line.split(b"|")[-2].strip()
18+
total = int(field) # microseconds
19+
return total

ci/azure/posix.yml

+26-26
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,57 @@ jobs:
99
strategy:
1010
matrix:
1111
${{ if eq(parameters.name, 'macOS') }}:
12-
py36_macos:
13-
ENV_FILE: ci/deps/azure-macos-36.yaml
14-
CONDA_PY: "36"
12+
py37_macos:
13+
ENV_FILE: ci/deps/azure-macos-37.yaml
14+
CONDA_PY: "37"
1515
PATTERN: "not slow and not network"
1616

1717
${{ if eq(parameters.name, 'Linux') }}:
18-
py36_minimum_versions:
19-
ENV_FILE: ci/deps/azure-36-minimum_versions.yaml
20-
CONDA_PY: "36"
18+
py37_minimum_versions:
19+
ENV_FILE: ci/deps/azure-37-minimum_versions.yaml
20+
CONDA_PY: "37"
2121
PATTERN: "not slow and not network and not clipboard"
2222

23-
py36_locale_slow_old_np:
24-
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
25-
CONDA_PY: "36"
23+
py37_locale_slow:
24+
ENV_FILE: ci/deps/azure-37-locale_slow.yaml
25+
CONDA_PY: "37"
2626
PATTERN: "slow"
2727
# pandas does not use the language (zh_CN), but should support different encodings (utf8)
2828
# we should test with encodings different than utf8, but doesn't seem like Ubuntu supports any
2929
LANG: "zh_CN.utf8"
3030
LC_ALL: "zh_CN.utf8"
3131
EXTRA_APT: "language-pack-zh-hans"
3232

33-
py36_slow:
34-
ENV_FILE: ci/deps/azure-36-slow.yaml
35-
CONDA_PY: "36"
33+
py37_slow:
34+
ENV_FILE: ci/deps/azure-37-slow.yaml
35+
CONDA_PY: "37"
3636
PATTERN: "slow"
3737

38-
py36_locale:
39-
ENV_FILE: ci/deps/azure-36-locale.yaml
40-
CONDA_PY: "36"
38+
py37_locale:
39+
ENV_FILE: ci/deps/azure-37-locale.yaml
40+
CONDA_PY: "37"
4141
PATTERN: "not slow and not network"
4242
LANG: "it_IT.utf8"
4343
LC_ALL: "it_IT.utf8"
4444
EXTRA_APT: "language-pack-it xsel"
4545

46-
#py36_32bit:
47-
# ENV_FILE: ci/deps/azure-36-32bit.yaml
48-
# CONDA_PY: "36"
49-
# PATTERN: "not slow and not network and not clipboard"
50-
# BITS32: "yes"
46+
# py37_32bit:
47+
# ENV_FILE: ci/deps/azure-37-32bit.yaml
48+
# CONDA_PY: "37"
49+
# PATTERN: "not slow and not network and not clipboard"
50+
# BITS32: "yes"
5151

52-
py37_locale:
53-
ENV_FILE: ci/deps/azure-37-locale.yaml
54-
CONDA_PY: "37"
52+
py38_locale:
53+
ENV_FILE: ci/deps/azure-38-locale.yaml
54+
CONDA_PY: "38"
5555
PATTERN: "not slow and not network"
5656
LANG: "zh_CN.utf8"
5757
LC_ALL: "zh_CN.utf8"
5858
EXTRA_APT: "language-pack-zh-hans xsel"
5959

60-
py37_np_dev:
61-
ENV_FILE: ci/deps/azure-37-numpydev.yaml
62-
CONDA_PY: "37"
60+
py38_np_dev:
61+
ENV_FILE: ci/deps/azure-38-numpydev.yaml
62+
CONDA_PY: "38"
6363
PATTERN: "not slow and not network"
6464
TEST_ARGS: "-W error"
6565
PANDAS_TESTING_MODE: "deprecate"

ci/azure/windows.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ jobs:
88
vmImage: ${{ parameters.vmImage }}
99
strategy:
1010
matrix:
11-
py36_np15:
12-
ENV_FILE: ci/deps/azure-windows-36.yaml
13-
CONDA_PY: "36"
14-
PATTERN: "not slow and not network"
15-
16-
py37_np18:
11+
py37_np16:
1712
ENV_FILE: ci/deps/azure-windows-37.yaml
1813
CONDA_PY: "37"
1914
PATTERN: "not slow and not network"
2015

16+
py38_np18:
17+
ENV_FILE: ci/deps/azure-windows-38.yaml
18+
CONDA_PY: "38"
19+
PATTERN: "not slow and not network"
20+
2121
steps:
2222
- powershell: |
2323
Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"

ci/code_checks.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
121121

122122
# Imports - Check formatting using isort see setup.cfg for settings
123123
MSG='Check import format using isort' ; echo $MSG
124-
ISORT_CMD="isort --quiet --check-only pandas asv_bench scripts"
124+
ISORT_CMD="isort --quiet --check-only pandas asv_bench scripts web"
125125
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
126126
eval $ISORT_CMD | awk '{print "##[error]" $0}'; RET=$(($RET + ${PIPESTATUS[0]}))
127127
else
@@ -230,6 +230,11 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
230230
invgrep -R --include="*.py" -P '# type: (?!ignore)' pandas
231231
RET=$(($RET + $?)) ; echo $MSG "DONE"
232232

233+
# https://github.com/python/mypy/issues/7384
234+
# MSG='Check for missing error codes with # type: ignore' ; echo $MSG
235+
# invgrep -R --include="*.py" -P '# type: ignore(?!\[)' pandas
236+
# RET=$(($RET + $?)) ; echo $MSG "DONE"
237+
233238
MSG='Check for use of foo.__class__ instead of type(foo)' ; echo $MSG
234239
invgrep -R --include=*.{py,pyx} '\.__class__' pandas
235240
RET=$(($RET + $?)) ; echo $MSG "DONE"

ci/deps/azure-36-32bit.yaml renamed to ci/deps/azure-37-32bit.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- python=3.6.*
6+
- python=3.7.*
77

88
# tools
9-
### Cython 0.29.13 and pytest 5.0.1 for 32 bits are not available with conda, installing below with pip instead
9+
### Cython 0.29.16 and pytest 5.0.1 for 32 bits are not available with conda, installing below with pip instead
1010
- pytest-xdist>=1.21
1111
- hypothesis>=3.58.0
1212
- pytest-azurepipelines
@@ -15,12 +15,12 @@ dependencies:
1515
- attrs=19.1.0
1616
- gcc_linux-32
1717
- gxx_linux-32
18-
- numpy=1.14.*
1918
- python-dateutil
20-
- pytz=2017.2
19+
- pytz=2017.3
2120

2221
# see comment above
2322
- pip
2423
- pip:
2524
- cython>=0.29.16
25+
- numpy>=1.16.5
2626
- pytest>=5.0.1

ci/deps/azure-37-locale.yaml

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: pandas-dev
22
channels:
3+
- defaults
34
- conda-forge
45
dependencies:
56
- python=3.7.*
@@ -22,7 +23,7 @@ dependencies:
2223
- moto
2324
- nomkl
2425
- numexpr
25-
- numpy
26+
- numpy=1.16.*
2627
- openpyxl
2728
- pytables
2829
- python-dateutil
@@ -32,7 +33,4 @@ dependencies:
3233
- xlrd
3334
- xlsxwriter
3435
- xlwt
35-
- pyarrow>=0.15
36-
- pip
37-
- pip:
38-
- pyxlsb
36+
- moto

ci/deps/azure-36-locale_slow.yaml renamed to ci/deps/azure-37-locale_slow.yaml

+8-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- python=3.6.*
6+
- python=3.7.*
77

88
# tools
99
- cython>=0.29.16
@@ -16,17 +16,15 @@ dependencies:
1616
- beautifulsoup4=4.6.0
1717
- bottleneck=1.2.*
1818
- lxml
19-
- matplotlib=2.2.2
20-
- numpy=1.14.*
19+
- matplotlib=3.0.0
20+
- numpy=1.16.*
2121
- openpyxl=2.5.7
2222
- python-dateutil
2323
- python-blosc
24-
- pytz=2017.2
24+
- pytz=2017.3
2525
- scipy
26-
- sqlalchemy=1.1.4
26+
- sqlalchemy=1.2.8
2727
- xlrd=1.1.0
28-
- xlsxwriter=0.9.8
29-
- xlwt=1.2.0
30-
- pip
31-
- pip:
32-
- html5lib==1.0b2
28+
- xlsxwriter=1.0.2
29+
- xlwt=1.3.0
30+
- html5lib=1.0.1

ci/deps/azure-36-minimum_versions.yaml renamed to ci/deps/azure-37-minimum_versions.yaml

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pandas-dev
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.6.1
5+
- python=3.7.1
66

77
# tools
88
- cython=0.29.16
@@ -15,16 +15,17 @@ dependencies:
1515
# pandas dependencies
1616
- beautifulsoup4=4.6.0
1717
- bottleneck=1.2.1
18-
- jinja2=2.8
18+
- jinja2=2.10
1919
- numba=0.46.0
20-
- numexpr=2.6.2
21-
- numpy=1.15.4
20+
- numexpr=2.6.8
21+
- numpy=1.16.5
2222
- openpyxl=2.5.7
23-
- pytables=3.4.3
23+
- pytables=3.4.4
2424
- python-dateutil=2.7.3
25-
- pytz=2017.2
25+
- pytz=2017.3
26+
- pyarrow=0.15
2627
- scipy=1.2
2728
- xlrd=1.1.0
28-
- xlsxwriter=0.9.8
29-
- xlwt=1.2.0
29+
- xlsxwriter=1.0.2
30+
- xlwt=1.3.0
3031
- html5lib=1.0.1

ci/deps/azure-36-slow.yaml renamed to ci/deps/azure-37-slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6-
- python=3.6.*
6+
- python=3.7.*
77

88
# tools
99
- cython>=0.29.16

0 commit comments

Comments
 (0)