Skip to content

Commit

Permalink
Merge pull request pandas-dev#307 from manahl/fix_tzfile_caching
Browse files Browse the repository at this point in the history
Revert "Cache for mktz pandas-dev#303"
  • Loading branch information
jamesblackburn committed Dec 22, 2016
2 parents ec9c337 + bee43d3 commit 975b3cc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

### 1.37
* Bugfix: #300 to_datetime deprecated in pandas, use to_pydatetime instead
* Feature: #303 Cache timezones in mktz for improved performance

### 1.36 (2016-12-13)

Expand Down
10 changes: 0 additions & 10 deletions arctic/date/_mktz.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import dateutil
import tzlocal
import six
import weakref


_TZ_CACHE = weakref.WeakValueDictionary()


class TimezoneError(Exception):
Expand Down Expand Up @@ -38,11 +34,6 @@ def mktz(zone=None):
if zone is None:
zone = tzlocal.get_localzone().zone
zone = six.u(zone)

cached = _TZ_CACHE.get(zone)
if cached is not None:
return cached

tz = dateutil.tz.gettz(zone)
if not tz:
raise TimezoneError('Timezone "%s" can not be read' % (zone))
Expand All @@ -53,5 +44,4 @@ def mktz(zone=None):
if zone.startswith(p):
tz.zone = zone[len(p) + 1:]
break
_TZ_CACHE[zone] = tz
return tz

0 comments on commit 975b3cc

Please sign in to comment.