Skip to content

Commit 72e99da

Browse files
committed
Fix asv errors and condition
1 parent 89ce37f commit 72e99da

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

asv_bench/benchmarks/timeseries.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -386,23 +386,20 @@ def time_format_exact(self):
386386
def time_format_no_exact(self):
387387
to_datetime(self.s, format='%d%b%y', exact=False)
388388

389-
def time_cache_with_unique_seconds_and unit(self):
390-
to_datetime(self.unique_numeric_seconds, unit='s')
389+
def time_cache_with_unique_seconds_and_unit(self):
390+
to_datetime(self.unique_numeric_seconds, unit='s')
391391

392392
def time_cache_with_dup_seconds_and_unit(self):
393-
to_datetime(self.dup_numeric_seconds, unit='s')
393+
to_datetime(self.dup_numeric_seconds, unit='s')
394394

395395
def time_cache_with_dup_string_dates(self):
396-
to_datetime(self.dup_string_dates)
396+
to_datetime(self.dup_string_dates)
397397

398398
def time_cache_with_dup_string_dates_and_format(self):
399-
to_datetime(self.dup_string_dates, format='%Y-%m-%d')
399+
to_datetime(self.dup_string_dates, format='%Y-%m-%d')
400400

401401
def time_cache_with_dup_string_tzoffset_dates(self):
402-
to_datetime(self.dup_string_with_tz)
403-
404-
def time_cache_with_dup_string_tzoffset_dates_and_format(self):
405-
to_datetim(self.dup_string_with_tz, format='%Y-%m-%d %H:%M:%S%z')
402+
to_datetime(self.dup_string_with_tz)
406403

407404

408405
class Offsets(object):

pandas/core/tools/datetimes.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,12 @@ def _convert_listlike(arg, box, format, name=None, tz=tz):
521521
arg = arg + offset
522522

523523
convert_cache = None
524-
if cache and is_list_like(arg):
525-
if len(arg) >= 1000:
526-
unique_dates = algorithms.unique(arg)
527-
if len(unique_dates) != len(arg):
528-
from pandas import Series
529-
cache_dates = _convert_listlike(unique_dates, False, format)
530-
convert_cache = Series(cache_dates, index=unique_dates)
524+
if cache and is_list_like(arg) and len(arg) >= 1000:
525+
unique_dates = algorithms.unique(arg)
526+
if len(unique_dates) != len(arg):
527+
from pandas import Series
528+
cache_dates = _convert_listlike(unique_dates, False, format)
529+
convert_cache = Series(cache_dates, index=unique_dates)
531530

532531
if isinstance(arg, tslib.Timestamp):
533532
result = arg

0 commit comments

Comments
 (0)