Skip to content

Commit 02ab4f3

Browse files
committed
Skip test related to GH 18111, lint
1 parent d059d44 commit 02ab4f3

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

doc/source/whatsnew/v0.21.0.txt

-1
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,6 @@ Performance Improvements
999999
- :attr:`Timestamp.microsecond` no longer re-computes on attribute access (:issue:`17331`)
10001000
- Improved performance of the :class:`CategoricalIndex` for data that is already categorical dtype (:issue:`17513`)
10011001
- Improved performance of :meth:`RangeIndex.min` and :meth:`RangeIndex.max` by using ``RangeIndex`` properties to perform the computations (:issue:`17607`)
1002-
- Added a keyword argument, `cache`, to :func:`to_datetime` that improved the performance of converting duplicate datetime arguments (:issue: `11665`)
10031002

10041003
.. _whatsnew_0210.docs:
10051004

doc/source/whatsnew/v0.21.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Deprecations
3939
Performance Improvements
4040
~~~~~~~~~~~~~~~~~~~~~~~~
4141

42-
-
42+
- Added a keyword argument, `cache`, to :func:`to_datetime` that improved the performance of converting duplicate datetime arguments (:issue: `11665`)
4343
-
4444
-
4545

pandas/core/tools/datetimes.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def _guess_datetime_format_for_array(arr, **kwargs):
3535
if len(non_nan_elements):
3636
return _guess_datetime_format(arr[non_nan_elements[0]], **kwargs)
3737

38+
3839
def _maybe_cache(arg, format, cache, tz, _convert_listlike):
3940
"""Create a cache of unique dates from an array of dates"""
4041
from pandas import Series
@@ -49,6 +50,7 @@ def _maybe_cache(arg, format, cache, tz, _convert_listlike):
4950
cache_array = Series(cache_dates, index=unique_dates)
5051
return cache_array
5152

53+
5254
def _convert_and_box_cache(arg, cache_array, box, errors, tz, name=None):
5355
"""Convert array of dates with a cache and box the result"""
5456
from pandas import Series
@@ -62,6 +64,7 @@ def _convert_and_box_cache(arg, cache_array, box, errors, tz, name=None):
6264
result = DatetimeIndex(result, tz=tz, name=name)
6365
return result
6466

67+
6568
def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
6669
utc=None, box=True, format=None, exact=True,
6770
unit=None, infer_datetime_format=False, origin='unix',
@@ -138,11 +141,11 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
138141
origin.
139142
140143
.. versionadded: 0.20.0
141-
cache : boolean, default True
142-
If True, use a cache of unique, converted dates to apply the datetime
144+
cache : boolean, default False
145+
If False, use a cache of unique, converted dates to apply the datetime
143146
conversion. Produces signficant speed-ups when parsing duplicate dates.
144147
145-
.. versionadded: 0.21.0
148+
.. versionadded: 0.21.1
146149
Returns
147150
-------
148151
ret : datetime if parsing succeeded.

pandas/tests/indexes/datetimes/test_tools.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ def test_to_datetime_tz_psycopg2(self, cache):
372372
dtype='datetime64[ns, UTC]')
373373
tm.assert_index_equal(result, expected)
374374

375-
@pytest.mark.parametrize('cache', [True, False])
375+
bool_skip = pytest.mark.skipif(True, reason="GH 18111")
376+
377+
@pytest.mark.parametrize('cache', [pytest.param(True, marks=bool_skip),
378+
False])
376379
def test_datetime_bool(self, cache):
377380
# GH13176
378381
with pytest.raises(TypeError):
@@ -450,7 +453,6 @@ def test_week_without_day_and_calendar_year(self, date, format):
450453

451454

452455
class TestToDatetimeUnit(object):
453-
454456
@pytest.mark.parametrize('cache', [True, False])
455457
def test_unit(self, cache):
456458
# GH 11758

0 commit comments

Comments
 (0)