Skip to content

Commit 40910cb

Browse files
cpcloudwesm
authored andcommitted
Revert "Fix compat by using text_type"
This reverts commit 292ac90.
1 parent b098d8a commit 40910cb

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

python/pyarrow/pandas_compat.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def get_column_metadata(column, name, arrow_type, field_name):
172172

173173
return {
174174
'name': name,
175-
'field_name': six.text_type(field_name),
175+
'field_name': str(field_name),
176176
'pandas_type': logical_type,
177177
'numpy_type': string_dtype,
178178
'metadata': extra_metadata,
@@ -277,17 +277,15 @@ def _column_name_to_strings(name):
277277
>>> _column_name_to_strings(name)
278278
('1', '2017-02-01 00:00:00')
279279
"""
280-
if isinstance(name, six.text_type):
280+
if isinstance(name, six.string_types):
281281
return name
282-
elif isinstance(name, six.binary_type):
283-
return name.decode('utf8')
284282
elif isinstance(name, tuple):
285283
return tuple(map(_column_name_to_strings, name))
286284
elif isinstance(name, collections.Sequence):
287285
raise TypeError("Unsupported type for MultiIndex level")
288286
elif name is None:
289287
return None
290-
return six.text_type(name)
288+
return str(name)
291289

292290

293291
def _index_level_name(index, i, column_names):
@@ -563,14 +561,10 @@ def table_to_blockmanager(options, table, memory_pool, nthreads=1,
563561
column_strings = [x.name for x in block_table.itercolumns()]
564562
if columns:
565563
columns_name_dict = {
566-
six.text_type(c['field_name']) if 'field_name' in c else c['name']:
567-
c['name'] for c in columns
564+
c.get('field_name', str(c['name'])): c['name'] for c in columns
568565
}
569566
columns_values = [
570-
columns_name_dict.get(
571-
six.text_type(name),
572-
columns_name_dict.get(name, name)
573-
) for name in column_strings
567+
columns_name_dict.get(name, name) for name in column_strings
574568
]
575569
else:
576570
columns_values = column_strings

0 commit comments

Comments
 (0)