Skip to content

Commit 68953ed

Browse files
committed
TST: fixup 32-bit failing tests
PTF
1 parent a993a03 commit 68953ed

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

pandas/core/format.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,6 @@ def __init__(self, obj, path_or_buf, sep=",", na_rep='', float_format=None,
778778
tupleize_cols=True):
779779

780780
self.engine = engine # remove for 0.12
781-
782-
obj._consolidate_inplace()
783781
self.obj = obj
784782

785783
self.path_or_buf = path_or_buf
@@ -835,7 +833,7 @@ def __init__(self, obj, path_or_buf, sep=",", na_rep='', float_format=None,
835833
self.blocks = self.obj._data.blocks
836834
ncols = sum(len(b.items) for b in self.blocks)
837835
self.data =[None] * ncols
838-
self.column_map = self.obj._data.get_items_map()
836+
self.column_map = self.obj._data.get_items_map(use_cached=False)
839837

840838
if chunksize is None:
841839
chunksize = (100000/ (len(self.cols) or 1)) or 1

pandas/core/internals.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,17 +1130,20 @@ def maybe_create_block(block):
11301130
# when we recreate the block manager if needed
11311131
return getattr(self,'_ref_locs',None)
11321132

1133-
def get_items_map(self):
1133+
def get_items_map(self, use_cached=True):
11341134
"""
11351135
return an inverted ref_loc map for an item index
11361136
block -> item (in that block) location -> column location
1137+
1138+
use_cached : boolean, use the cached items map, or recreate
11371139
"""
11381140

11391141
# cache check
1140-
im = getattr(self,'_items_map',None)
1141-
if im is not None:
1142-
return im
1143-
1142+
if use_cached:
1143+
im = getattr(self,'_items_map',None)
1144+
if im is not None:
1145+
return im
1146+
11441147
im = dict()
11451148
rl = self._set_ref_locs()
11461149

pandas/tests/test_frame.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4942,7 +4942,7 @@ def test_to_csv_no_index(self):
49424942
df.to_csv(path, index=False)
49434943
result = read_csv(path)
49444944
assert_frame_equal(df,result)
4945-
df['c3'] = [7,8,9]
4945+
df['c3'] = Series([7,8,9],dtype='int64')
49464946
df.to_csv(path, index=False)
49474947
result = read_csv(path)
49484948
assert_frame_equal(df,result)
@@ -5000,7 +5000,8 @@ def _make_frame(names=None):
50005000
columns=MultiIndex.from_tuples([('bah', 'foo'),
50015001
('bah', 'bar'),
50025002
('ban', 'baz')],
5003-
names=names))
5003+
names=names),
5004+
dtype='int64')
50045005

50055006
# column & index are multi-index
50065007
df = mkdf(5,3,r_idx_nlevels=2,c_idx_nlevels=4)

0 commit comments

Comments
 (0)