Skip to content

Commit 4b69503

Browse files
committed
Merge remote-tracking branch 'upstream/master' into issue44994
2 parents 9e57d6d + 14287e3 commit 4b69503

File tree

13 files changed

+54
-42
lines changed

13 files changed

+54
-42
lines changed

.github/workflows/python-dev.yml

Lines changed: 2 additions & 1 deletion
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

azure-pipelines.yml

Lines changed: 2 additions & 1 deletion
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 . && \

ci/code_checks.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,21 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
6666

6767
MSG='Doctests' ; echo $MSG
6868
python -m pytest --doctest-modules \
69+
pandas/_config/ \
6970
pandas/_libs/ \
71+
pandas/_testing/ \
7072
pandas/api/ \
7173
pandas/arrays/ \
7274
pandas/compat/ \
7375
pandas/core \
7476
pandas/errors/ \
75-
pandas/io/clipboard/ \
76-
pandas/io/json/ \
77-
pandas/io/excel/ \
78-
pandas/io/parsers/ \
79-
pandas/io/sas/ \
80-
pandas/io/sql.py \
81-
pandas/io/formats/format.py \
82-
pandas/io/formats/style.py \
83-
pandas/io/stata.py \
84-
pandas/tseries/
77+
pandas/io/ \
78+
pandas/tseries/ \
79+
pandas/util/ \
80+
pandas/_typing.py \
81+
pandas/_version.py \
82+
pandas/conftest.py \
83+
pandas/testing.py
8584
RET=$(($RET + $?)) ; echo $MSG "DONE"
8685

8786
MSG='Cython Doctests' ; echo $MSG

ci/setup_env.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ echo "[Build extensions]"
106106
python setup.py build_ext -q -j2
107107

108108
echo "[Updating pip]"
109-
python -m pip install --no-deps -U pip wheel setuptools
109+
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
110+
python -m pip install --no-deps -U pip wheel "setuptools<60.0.0"
110111

111112
echo "[Install pandas]"
112113
python -m pip install --no-build-isolation -e .

pandas/_config/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ class option_context(ContextDecorator):
411411
Examples
412412
--------
413413
>>> with option_context('display.max_rows', 10, 'display.max_columns', 5):
414-
... ...
414+
... pass
415415
"""
416416

417417
def __init__(self, *args):

pandas/_testing/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def _make_timeseries(start="2000-01-01", end="2000-12-31", freq="1D", seed=None)
431431
432432
Examples
433433
--------
434-
>>> _make_timeseries()
434+
>>> _make_timeseries() # doctest: +SKIP
435435
id name x y
436436
timestamp
437437
2000-01-01 982 Frank 0.031261 0.986727

pandas/_testing/_io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def network(
167167
... def test_network():
168168
... with pd.io.common.urlopen("rabbit://bonanza.com"):
169169
... pass
170-
>>> test_network()
170+
>>> test_network() # doctest: +SKIP
171171
Traceback
172172
...
173173
URLError: <urlopen error unknown url type: rabbit>
@@ -189,7 +189,7 @@ def network(
189189
... def test_something():
190190
... print("I ran!")
191191
... raise ValueError("Failure")
192-
>>> test_something()
192+
>>> test_something() # doctest: +SKIP
193193
Traceback (most recent call last):
194194
...
195195

pandas/_testing/asserters.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,15 @@ def _get_tol_from_less_precise(check_less_precise: bool | int) -> float:
193193
--------
194194
>>> # Using check_less_precise as a bool:
195195
>>> _get_tol_from_less_precise(False)
196-
0.5e-5
196+
5e-06
197197
>>> _get_tol_from_less_precise(True)
198-
0.5e-3
198+
0.0005
199199
>>> # Using check_less_precise as an int representing the decimal
200200
>>> # tolerance intended:
201201
>>> _get_tol_from_less_precise(2)
202-
0.5e-2
202+
0.005
203203
>>> _get_tol_from_less_precise(8)
204-
0.5e-8
205-
204+
5e-09
206205
"""
207206
if isinstance(check_less_precise, bool):
208207
if check_less_precise:

pandas/_testing/contexts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ def set_timezone(tz: str):
5454
--------
5555
>>> from datetime import datetime
5656
>>> from dateutil.tz import tzlocal
57-
>>> tzlocal().tzname(datetime.now())
57+
>>> tzlocal().tzname(datetime(2021, 1, 1)) # doctest: +SKIP
5858
'IST'
5959
6060
>>> with set_timezone('US/Eastern'):
61-
... tzlocal().tzname(datetime.now())
61+
... tzlocal().tzname(datetime(2021, 1, 1))
6262
...
63-
'EDT'
63+
'EST'
6464
"""
6565
import os
6666
import time

pandas/io/formats/style_render.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ def format_index(
10621062
--------
10631063
Using ``na_rep`` and ``precision`` with the default ``formatter``
10641064
1065-
>>> df = pd.DataFrame([[1, 2, 3]], columns=[2.0, np.nan, 4.0]])
1065+
>>> df = pd.DataFrame([[1, 2, 3]], columns=[2.0, np.nan, 4.0])
10661066
>>> df.style.format_index(axis=1, na_rep='MISS', precision=3) # doctest: +SKIP
10671067
2.000 MISS 4.000
10681068
0 1 2 3
@@ -1096,6 +1096,7 @@ def format_index(
10961096
10971097
>>> df = pd.DataFrame([[1, 2, 3]], columns=['"A"', 'A&B', None])
10981098
>>> s = df.style.format_index('$ {0}', axis=1, escape="html", na_rep="NA")
1099+
... # doctest: +SKIP
10991100
<th .. >$ &#34;A&#34;</th>
11001101
<th .. >$ A&amp;B</th>
11011102
<th .. >NA</td>
@@ -1811,7 +1812,7 @@ def _parse_latex_header_span(
18111812
18121813
Examples
18131814
--------
1814-
>>> cell = {'display_value':'text', 'attributes': 'colspan="3"'}
1815+
>>> cell = {'cellstyle': '', 'display_value':'text', 'attributes': 'colspan="3"'}
18151816
>>> _parse_latex_header_span(cell, 't', 'c')
18161817
'\\multicolumn{3}{c}{text}'
18171818
"""

pandas/tests/io/json/test_json_table_schema_ext_dtype.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ def setup_method(self, method):
131131
}
132132
)
133133

134-
def test_build_date_series(self):
134+
def test_build_date_series(self, using_array_manager):
135+
if using_array_manager:
136+
pytest.skip("Segfault for array manager GH44994")
137+
135138
s = Series(self.da, name="a")
136139
s.index.name = "id"
137140
result = s.to_json(orient="table", date_format="iso")
@@ -156,7 +159,10 @@ def test_build_date_series(self):
156159

157160
assert result == expected
158161

159-
def test_build_decimal_series(self):
162+
def test_build_decimal_series(self, using_array_manager):
163+
if using_array_manager:
164+
pytest.skip("Segfault for array manager GH44994")
165+
160166
s = Series(self.dc, name="a")
161167
s.index.name = "id"
162168
result = s.to_json(orient="table", date_format="iso")
@@ -231,7 +237,10 @@ def test_build_int64_series(self):
231237

232238
assert result == expected
233239

234-
def test_to_json(self):
240+
def test_to_json(self, using_array_manager):
241+
if using_array_manager:
242+
pytest.skip("Segfault for array manager GH44994")
243+
235244
df = self.df.copy()
236245
df.index.name = "idx"
237246
result = df.to_json(orient="table", date_format="iso")

pandas/util/_decorators.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,19 @@ def deprecate_kwarg(
122122
>>> f(columns='should work ok')
123123
should work ok
124124
125-
>>> f(cols='should raise warning')
125+
>>> f(cols='should raise warning') # doctest: +SKIP
126126
FutureWarning: cols is deprecated, use columns instead
127127
warnings.warn(msg, FutureWarning)
128128
should raise warning
129129
130-
>>> f(cols='should error', columns="can\'t pass do both")
130+
>>> f(cols='should error', columns="can\'t pass do both") # doctest: +SKIP
131131
TypeError: Can only specify 'cols' or 'columns', not both
132132
133133
>>> @deprecate_kwarg('old', 'new', {'yes': True, 'no': False})
134134
... def f(new=False):
135135
... print('yes!' if new else 'no!')
136136
...
137-
>>> f(old='yes')
137+
>>> f(old='yes') # doctest: +SKIP
138138
FutureWarning: old='yes' is deprecated, use new=True instead
139139
warnings.warn(msg, FutureWarning)
140140
yes!
@@ -145,14 +145,14 @@ def deprecate_kwarg(
145145
... def f(cols='', another_param=''):
146146
... print(cols)
147147
...
148-
>>> f(cols='should raise warning')
148+
>>> f(cols='should raise warning') # doctest: +SKIP
149149
FutureWarning: the 'cols' keyword is deprecated and will be removed in a
150150
future version please takes steps to stop use of 'cols'
151151
should raise warning
152-
>>> f(another_param='should not raise warning')
152+
>>> f(another_param='should not raise warning') # doctest: +SKIP
153153
should not raise warning
154154
155-
>>> f(cols='should raise warning', another_param='')
155+
>>> f(cols='should raise warning', another_param='') # doctest: +SKIP
156156
FutureWarning: the 'cols' keyword is deprecated and will be removed in a
157157
future version please takes steps to stop use of 'cols'
158158
should raise warning

pandas/util/_validators.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,15 @@ def validate_axis_style_args(data, args, kwargs, arg_name, method_name):
281281
282282
Examples
283283
--------
284-
>>> df._validate_axis_style_args((str.upper,), {'columns': id},
285-
... 'mapper', 'rename')
286-
{'columns': <function id>, 'index': <method 'upper' of 'str' objects>}
284+
>>> df = pd.DataFrame(range(2))
285+
>>> validate_axis_style_args(df, (str.upper,), {'columns': id},
286+
... 'mapper', 'rename')
287+
{'columns': <built-in function id>, 'index': <method 'upper' of 'str' objects>}
287288
288289
This emits a warning
289-
>>> df._validate_axis_style_args((str.upper, id), {},
290-
... 'mapper', 'rename')
291-
{'columns': <function id>, 'index': <method 'upper' of 'str' objects>}
290+
>>> validate_axis_style_args(df, (str.upper, id), {},
291+
... 'mapper', 'rename')
292+
{'index': <method 'upper' of 'str' objects>, 'columns': <built-in function id>}
292293
"""
293294
# TODO: Change to keyword-only args and remove all this
294295

0 commit comments

Comments
 (0)