Skip to content

Commit e95b5f1

Browse files
Licht-Twesm
authored andcommitted
BUG: Convert str by frombytes on pandas_compat.py
1 parent 1193bb5 commit e95b5f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/pyarrow/pandas_compat.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import six
2828

2929
import pyarrow as pa
30-
from pyarrow.compat import PY2, zip_longest # noqa
30+
from pyarrow.compat import PY2, zip_longest, frombytes # noqa
3131

3232

3333
def infer_dtype(column):
@@ -171,7 +171,7 @@ def get_column_metadata(column, name, arrow_type, field_name):
171171
)
172172

173173
if not isinstance(field_name, six.string_types):
174-
field_name = str(field_name)
174+
field_name = frombytes(str(field_name))
175175

176176
return {
177177
'name': name,
@@ -319,7 +319,7 @@ def dataframe_to_arrays(df, schema, preserve_index, nthreads=1):
319319
if not isinstance(name, six.string_types):
320320
name = _column_name_to_strings(name)
321321
if name is not None:
322-
name = str(name)
322+
name = frombytes(str(name))
323323

324324
if schema is not None:
325325
field = schema.field_by_name(name)
@@ -550,7 +550,7 @@ def table_to_blockmanager(options, table, memory_pool, nthreads=1,
550550
for c in columns:
551551
column_name = c['name']
552552
if not isinstance(column_name, six.text_type):
553-
column_name = str(column_name)
553+
column_name = frombytes(str(column_name))
554554

555555
columns_name_dict[c.get('field_name', column_name)] = c['name']
556556

0 commit comments

Comments
 (0)