Skip to content

Commit 8f254e3

Browse files
committed
Added a whatsnew entry + ensured constants are imported correctly by test_tslib.py
1 parent 5b3e291 commit 8f254e3

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

doc/source/whatsnew/v0.18.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Performance Improvements
243243

244244

245245
- Improved performance of ``DataFrame.to_sql`` when checking case sensitivity for tables. Now only checks if table has been created correctly when table name is not lower case. (:issue:`12876`)
246-
246+
- Improved performance of creating multiple instances of Period. This has regressed from ``O(1)`` to ``O(n)`` in terms on number of calls to ``_find_and_load`` between ``0.15.2`` and ``0.18.0``. (:issue:`12903`, :issue:`11831`)
247247

248248

249249

pandas/tseries/tests/test_tslib.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
from pandas.tslib import get_timezone
1212
from pandas._period import period_asfreq, period_ordinal
1313
from pandas.tseries.index import date_range, DatetimeIndex
14-
from pandas.tseries.frequencies import get_freq
14+
from pandas.tseries.frequencies import (
15+
get_freq,
16+
US_RESO, MS_RESO, S_RESO, H_RESO, D_RESO, T_RESO
17+
)
1518
import pandas.tseries.tools as tools
1619
import pandas.tseries.offsets as offsets
1720
import pandas.util.testing as tm
@@ -1307,11 +1310,11 @@ def test_resolution(self):
13071310

13081311
for freq, expected in zip(['A', 'Q', 'M', 'D', 'H', 'T',
13091312
'S', 'L', 'U'],
1310-
[period.D_RESO, period.D_RESO,
1311-
period.D_RESO, period.D_RESO,
1312-
period.H_RESO, period.T_RESO,
1313-
period.S_RESO, period.MS_RESO,
1314-
period.US_RESO]):
1313+
[D_RESO, D_RESO,
1314+
D_RESO, D_RESO,
1315+
H_RESO, T_RESO,
1316+
S_RESO, MS_RESO,
1317+
US_RESO]):
13151318
for tz in [None, 'Asia/Tokyo', 'US/Eastern',
13161319
'dateutil/US/Eastern']:
13171320
idx = date_range(start='2013-04-01', periods=30, freq=freq,

0 commit comments

Comments
 (0)