Skip to content

Commit c55ee43

Browse files
committed
Merge pull request #5180 from jreback/pytables_clean
TST: addtl pytables tests
2 parents abc5461 + 885bf17 commit c55ee43

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

pandas/io/pytables.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@ def convert(self, values, nan_rep, encoding):
18011801
elif dtype == u('date'):
18021802
try:
18031803
self.data = np.array(
1804-
[date.fromordinal(v) for v in data], dtype=object)
1804+
[date.fromordinal(v) for v in self.data], dtype=object)
18051805
except (ValueError):
18061806
self.data = np.array(
18071807
[date.fromtimestamp(v) for v in self.data], dtype=object)
@@ -3882,7 +3882,7 @@ def _unconvert_index(data, kind, encoding=None):
38823882
[date.fromordinal(v) for v in data], dtype=object)
38833883
except (ValueError):
38843884
index = np.array(
3885-
[date.fromtimestamp(v) for v in self.data], dtype=object)
3885+
[date.fromtimestamp(v) for v in data], dtype=object)
38863886
elif kind in (u('integer'), u('float')):
38873887
index = np.array(data)
38883888
elif kind in (u('string')):

pandas/io/tests/test_pytables.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,16 @@ def test_store_timezone(self):
18091809
import time
18101810
import os
18111811

1812+
# original method
1813+
with ensure_clean(self.path) as store:
1814+
1815+
today = datetime.date(2013,9,10)
1816+
df = DataFrame([1,2,3], index = [today, today, today])
1817+
store['obj1'] = df
1818+
result = store['obj1']
1819+
assert_frame_equal(result, df)
1820+
1821+
# with tz setting
18121822
orig_tz = os.environ.get('TZ')
18131823

18141824
def setTZ(tz):

0 commit comments

Comments
 (0)