Skip to content

Commit cadca37

Browse files
committed
CLN: removed convert_objects step in create_axes (no longer needed)
1 parent 8b4a874 commit cadca37

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

pandas/io/pytables.py

-22
Original file line numberDiff line numberDiff line change
@@ -2116,22 +2116,6 @@ def get_object(self, obj):
21162116
""" return the data for this obj """
21172117
return obj
21182118

2119-
def convert_objects(self, obj):
2120-
""" attempt to convert any object fields; don't touch other fields
2121-
if we are converting anything, copy the object and modify the copy """
2122-
new_obj = None
2123-
convert_f = lambda x: lib.maybe_convert_objects(x, convert_datetime=True)
2124-
2125-
for col, s in obj.iteritems():
2126-
if s.dtype == np.object_:
2127-
if new_obj is None:
2128-
new_obj = obj.copy()
2129-
new_obj[col] = convert_f(s)
2130-
2131-
if new_obj is not None:
2132-
return new_obj
2133-
return obj
2134-
21352119
def create_axes(self, axes, obj, validate=True, nan_rep=None, data_columns=None, min_itemsize=None, **kwargs):
21362120
""" create and return the axes
21372121
leagcy tables create an indexable column, indexable index, non-indexable fields
@@ -2177,9 +2161,6 @@ def create_axes(self, axes, obj, validate=True, nan_rep=None, data_columns=None,
21772161
nan_rep = 'nan'
21782162
self.nan_rep = nan_rep
21792163

2180-
# convert the objects if we can to better divine dtypes
2181-
obj = self.convert_objects(obj)
2182-
21832164
# create axes to index and non_index
21842165
index_axes_map = dict()
21852166
for i, a in enumerate(obj.axes):
@@ -2780,9 +2761,6 @@ def get_object(self, obj):
27802761
obj = obj.transpose(*self.data_orientation)
27812762
return obj
27822763

2783-
def convert_objects(self, obj):
2784-
return obj
2785-
27862764
@property
27872765
def is_transposed(self):
27882766
return self.data_orientation != tuple(range(self.ndim))

0 commit comments

Comments
 (0)