Skip to content

Commit 441f4f2

Browse files
committed
Merge remote-tracking branch 'upstream/master' into tests/test_rolling_max_datetimeindex
2 parents a4729b2 + cb05112 commit 441f4f2

File tree

285 files changed

+5112
-5290
lines changed

Some content is hidden

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

285 files changed

+5112
-5290
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ on:
88

99
env:
1010
ENV_FILE: environment.yml
11-
# TODO: remove export PATH=... in each step once this works
12-
# PATH: $HOME/miniconda3/bin:$PATH
1311

1412
jobs:
1513
checks:
@@ -20,84 +18,80 @@ jobs:
2018
- name: Checkout
2119
uses: actions/checkout@v1
2220

21+
- name: Setting conda path
22+
run: echo "::set-env name=PATH::${HOME}/miniconda3/bin:${PATH}"
23+
2324
- name: Looking for unwanted patterns
2425
run: ci/code_checks.sh patterns
2526
if: true
2627

2728
- name: Setup environment and build pandas
28-
run: |
29-
export PATH=$HOME/miniconda3/bin:$PATH
30-
ci/setup_env.sh
29+
run: ci/setup_env.sh
3130
if: true
3231

3332
- name: Linting
3433
run: |
35-
export PATH=$HOME/miniconda3/bin:$PATH
3634
source activate pandas-dev
3735
ci/code_checks.sh lint
3836
if: true
3937

4038
- name: Dependencies consistency
4139
run: |
42-
export PATH=$HOME/miniconda3/bin:$PATH
4340
source activate pandas-dev
4441
ci/code_checks.sh dependencies
4542
if: true
4643

4744
- name: Checks on imported code
4845
run: |
49-
export PATH=$HOME/miniconda3/bin:$PATH
5046
source activate pandas-dev
5147
ci/code_checks.sh code
5248
if: true
5349

5450
- name: Running doctests
5551
run: |
56-
export PATH=$HOME/miniconda3/bin:$PATH
5752
source activate pandas-dev
5853
ci/code_checks.sh doctests
5954
if: true
6055

6156
- name: Docstring validation
6257
run: |
63-
export PATH=$HOME/miniconda3/bin:$PATH
6458
source activate pandas-dev
6559
ci/code_checks.sh docstrings
6660
if: true
6761

6862
- name: Typing validation
6963
run: |
70-
export PATH=$HOME/miniconda3/bin:$PATH
7164
source activate pandas-dev
7265
ci/code_checks.sh typing
7366
if: true
7467

7568
- name: Testing docstring validation script
7669
run: |
77-
export PATH=$HOME/miniconda3/bin:$PATH
7870
source activate pandas-dev
7971
pytest --capture=no --strict scripts
8072
if: true
8173

8274
- name: Running benchmarks
8375
run: |
84-
export PATH=$HOME/miniconda3/bin:$PATH
8576
source activate pandas-dev
8677
cd asv_bench
8778
asv check -E existing
8879
git remote add upstream https://github.com/pandas-dev/pandas.git
8980
git fetch upstream
9081
if git diff upstream/master --name-only | grep -q "^asv_bench/"; then
9182
asv machine --yes
92-
ASV_OUTPUT="$(asv dev)"
93-
if [[ $(echo "$ASV_OUTPUT" | grep "failed") ]]; then
94-
echo "##vso[task.logissue type=error]Benchmarks run with errors"
95-
echo "$ASV_OUTPUT"
83+
asv dev | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log
84+
if grep "failed" benchmarks.log > /dev/null ; then
9685
exit 1
97-
else
98-
echo "Benchmarks run without errors"
9986
fi
10087
else
10188
echo "Benchmarks did not run, no changes detected"
10289
fi
10390
if: true
91+
92+
- name: Publish benchmarks artifact
93+
uses: actions/upload-artifact@master
94+
with:
95+
name: Benchmarks log
96+
path: asv_bench/benchmarks.log
97+
if: failure()

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,11 @@ pip install pandas
164164
```
165165

166166
## Dependencies
167-
- [NumPy](https://www.numpy.org): 1.13.3 or higher
168-
- [python-dateutil](https://labix.org/python-dateutil): 2.5.0 or higher
169-
- [pytz](https://pythonhosted.org/pytz): 2015.4 or higher
167+
- [NumPy](https://www.numpy.org)
168+
- [python-dateutil](https://labix.org/python-dateutil)
169+
- [pytz](https://pythonhosted.org/pytz)
170170

171-
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies)
172-
for recommended and optional dependencies.
171+
See the [full installation instructions](https://pandas.pydata.org/pandas-docs/stable/install.html#dependencies) for minimum supported versions of required, recommended and optional dependencies.
173172

174173
## Installation from sources
175174
To install pandas from source you need Cython in addition to the normal

asv_bench/benchmarks/categoricals.py

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,6 @@
1414
pass
1515

1616

17-
class Concat:
18-
def setup(self):
19-
N = 10 ** 5
20-
self.s = pd.Series(list("aabbcd") * N).astype("category")
21-
22-
self.a = pd.Categorical(list("aabbcd") * N)
23-
self.b = pd.Categorical(list("bbcdjk") * N)
24-
25-
def time_concat(self):
26-
pd.concat([self.s, self.s])
27-
28-
def time_union(self):
29-
union_categoricals([self.a, self.b])
30-
31-
3217
class Constructor:
3318
def setup(self):
3419
N = 10 ** 5
@@ -77,6 +62,33 @@ def time_existing_series(self):
7762
pd.Categorical(self.series)
7863

7964

65+
class CategoricalOps:
66+
params = ["__lt__", "__le__", "__eq__", "__ne__", "__ge__", "__gt__"]
67+
param_names = ["op"]
68+
69+
def setup(self, op):
70+
N = 10 ** 5
71+
self.cat = pd.Categorical(list("aabbcd") * N, ordered=True)
72+
73+
def time_categorical_op(self, op):
74+
getattr(self.cat, op)("b")
75+
76+
77+
class Concat:
78+
def setup(self):
79+
N = 10 ** 5
80+
self.s = pd.Series(list("aabbcd") * N).astype("category")
81+
82+
self.a = pd.Categorical(list("aabbcd") * N)
83+
self.b = pd.Categorical(list("bbcdjk") * N)
84+
85+
def time_concat(self):
86+
pd.concat([self.s, self.s])
87+
88+
def time_union(self):
89+
union_categoricals([self.a, self.b])
90+
91+
8092
class ValueCounts:
8193

8294
params = [True, False]

asv_bench/benchmarks/timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class InferFreq:
113113
def setup(self, freq):
114114
if freq is None:
115115
self.idx = date_range(start="1/1/1700", freq="D", periods=10000)
116-
self.idx.freq = None
116+
self.idx._data._freq = None
117117
else:
118118
self.idx = date_range(start="1/1/1700", freq=freq, periods=10000)
119119

azure-pipelines.yml

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -16,95 +16,6 @@ jobs:
1616
name: Windows
1717
vmImage: vs2017-win2016
1818

19-
- job: 'Checks'
20-
pool:
21-
vmImage: ubuntu-16.04
22-
timeoutInMinutes: 90
23-
steps:
24-
- script: |
25-
echo '##vso[task.prependpath]$(HOME)/miniconda3/bin'
26-
echo '##vso[task.setvariable variable=ENV_FILE]environment.yml'
27-
echo '##vso[task.setvariable variable=AZURE]true'
28-
displayName: 'Setting environment variables'
29-
30-
# Do not require a conda environment
31-
- script: ci/code_checks.sh patterns
32-
displayName: 'Looking for unwanted patterns'
33-
condition: true
34-
35-
- script: |
36-
sudo apt-get update
37-
sudo apt-get install -y libc6-dev-i386
38-
ci/setup_env.sh
39-
displayName: 'Setup environment and build pandas'
40-
condition: true
41-
42-
# Do not require pandas
43-
- script: |
44-
source activate pandas-dev
45-
ci/code_checks.sh lint
46-
displayName: 'Linting'
47-
condition: true
48-
49-
- script: |
50-
source activate pandas-dev
51-
ci/code_checks.sh dependencies
52-
displayName: 'Dependencies consistency'
53-
condition: true
54-
55-
# Require pandas
56-
- script: |
57-
source activate pandas-dev
58-
ci/code_checks.sh code
59-
displayName: 'Checks on imported code'
60-
condition: true
61-
62-
- script: |
63-
source activate pandas-dev
64-
ci/code_checks.sh doctests
65-
displayName: 'Running doctests'
66-
condition: true
67-
68-
- script: |
69-
source activate pandas-dev
70-
ci/code_checks.sh docstrings
71-
displayName: 'Docstring validation'
72-
condition: true
73-
74-
- script: |
75-
source activate pandas-dev
76-
ci/code_checks.sh typing
77-
displayName: 'Typing validation'
78-
condition: true
79-
80-
- script: |
81-
source activate pandas-dev
82-
pytest --capture=no --strict scripts
83-
displayName: 'Testing docstring validation script'
84-
condition: true
85-
86-
- script: |
87-
source activate pandas-dev
88-
cd asv_bench
89-
asv check -E existing
90-
git remote add upstream https://github.com/pandas-dev/pandas.git
91-
git fetch upstream
92-
if git diff upstream/master --name-only | grep -q "^asv_bench/"; then
93-
asv machine --yes
94-
ASV_OUTPUT="$(asv dev)"
95-
if [[ $(echo "$ASV_OUTPUT" | grep "failed") ]]; then
96-
echo "##vso[task.logissue type=error]Benchmarks run with errors"
97-
echo "$ASV_OUTPUT"
98-
exit 1
99-
else
100-
echo "Benchmarks run without errors"
101-
fi
102-
else
103-
echo "Benchmarks did not run, no changes detected"
104-
fi
105-
displayName: 'Running benchmarks'
106-
condition: true
107-
10819
- job: 'Web_and_Docs'
10920
pool:
11021
vmImage: ubuntu-16.04

ci/azure/posix.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,13 @@ jobs:
4444
PATTERN: "not slow and not network"
4545
LOCALE_OVERRIDE: "zh_CN.UTF-8"
4646

47-
# https://github.com/pandas-dev/pandas/issues/29432
48-
# py37_np_dev:
49-
# ENV_FILE: ci/deps/azure-37-numpydev.yaml
50-
# CONDA_PY: "37"
51-
# PATTERN: "not slow and not network"
52-
# TEST_ARGS: "-W error"
53-
# PANDAS_TESTING_MODE: "deprecate"
54-
# EXTRA_APT: "xsel"
55-
# # TODO:
56-
# continueOnError: true
47+
py37_np_dev:
48+
ENV_FILE: ci/deps/azure-37-numpydev.yaml
49+
CONDA_PY: "37"
50+
PATTERN: "not slow and not network"
51+
TEST_ARGS: "-W error"
52+
PANDAS_TESTING_MODE: "deprecate"
53+
EXTRA_APT: "xsel"
5754

5855
steps:
5956
- script: |

ci/code_checks.sh

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,13 @@ function invgrep {
3434
#
3535
# This is useful for the CI, as we want to fail if one of the patterns
3636
# that we want to avoid is found by grep.
37-
if [[ "$AZURE" == "true" ]]; then
38-
set -o pipefail
39-
grep -n "$@" | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Found unwanted pattern: " $3}'
40-
else
41-
grep "$@"
42-
fi
43-
return $((! $?))
37+
grep -n "$@" | sed "s/^/$INVGREP_PREPEND/" | sed "s/$/$INVGREP_APPEND/" ; EXIT_STATUS=${PIPESTATUS[0]}
38+
return $((! $EXIT_STATUS))
4439
}
4540

46-
if [[ "$AZURE" == "true" ]]; then
47-
FLAKE8_FORMAT="##vso[task.logissue type=error;sourcepath=%(path)s;linenumber=%(row)s;columnnumber=%(col)s;code=%(code)s;]%(text)s"
41+
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
42+
FLAKE8_FORMAT="##[error]%(path)s:%(row)s:%(col)s:%(code):%(text)s"
43+
INVGREP_PREPEND="##[error]"
4844
else
4945
FLAKE8_FORMAT="default"
5046
fi
@@ -194,15 +190,15 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
194190
invgrep -R --include="*.py" --include="*.pyx" -E 'class.*:\n\n( )+"""' .
195191
RET=$(($RET + $?)) ; echo $MSG "DONE"
196192

193+
MSG='Check for use of comment-based annotation syntax' ; echo $MSG
194+
invgrep -R --include="*.py" -P '# type: (?!ignore)' pandas
195+
RET=$(($RET + $?)) ; echo $MSG "DONE"
196+
197197
MSG='Check that no file in the repo contains trailing whitespaces' ; echo $MSG
198-
set -o pipefail
199-
if [[ "$AZURE" == "true" ]]; then
200-
# we exclude all c/cpp files as the c/cpp files of pandas code base are tested when Linting .c and .h files
201-
! grep -n '--exclude=*.'{svg,c,cpp,html,js} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Tailing whitespaces found: " $3}'
202-
else
203-
! grep -n '--exclude=*.'{svg,c,cpp,html,js} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print $1 ":" $2 ":Tailing whitespaces found: " $3}'
204-
fi
198+
INVGREP_APPEND=" <- trailing whitespaces found"
199+
invgrep -RI --exclude=\*.{svg,c,cpp,html,js} --exclude-dir=env "\s$" *
205200
RET=$(($RET + $?)) ; echo $MSG "DONE"
201+
unset INVGREP_APPEND
206202
fi
207203

208204
### CODE ###

ci/deps/azure-36-32bit.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@ channels:
33
- defaults
44
- conda-forge
55
dependencies:
6+
- python=3.6.*
7+
8+
# tools
9+
### Cython 0.29.13 and pytest 5.0.1 for 32 bits are not available with conda, installing below with pip instead
10+
- pytest-xdist>=1.21
11+
- hypothesis>=3.58.0
12+
- pytest-azurepipelines
13+
14+
# pandas dependencies
615
- attrs=19.1.0
716
- gcc_linux-32
8-
- gcc_linux-32
917
- gxx_linux-32
1018
- numpy=1.14.*
1119
- python-dateutil
12-
- python=3.6.*
1320
- pytz=2017.2
14-
# universal
15-
- pytest
16-
- pytest-xdist
17-
- pytest-mock
18-
- pytest-azurepipelines
19-
- hypothesis>=3.58.0
21+
22+
# see comment above
2023
- pip
2124
- pip:
22-
# Anaconda doesn't build a new enough Cython
2325
- cython>=0.29.13
26+
- pytest>=5.0.1

0 commit comments

Comments
 (0)