Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/pyarrow/pandas_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ def _backwards_compatible_index_name(raw_name, logical_name):
'string': np.str_,
'empty': np.object_,
'mixed': np.object_,
'mixed-integer': np.object_
}


Expand Down
8 changes: 7 additions & 1 deletion python/pyarrow/tests/test_convert_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ class TestConvertMisc(object):
(np.object, pa.binary()),
(np.object, pa.binary(10)),
(np.object, pa.list_(pa.int64())),
]
]

def test_all_none_objects(self):
df = pd.DataFrame({'a': [None, None, None]})
Expand Down Expand Up @@ -1985,6 +1985,12 @@ def test_non_natural_stride(self):
arr = pa.array(data['y'], type=pa.int16())
assert arr.to_pylist() == [-1, 2]

def test_mixed_integer_columns(self):
row = [[], []]
df = pd.DataFrame(data=[row], columns=['foo', 123])
expected_df = pd.DataFrame(data=[row], columns=['foo', '123'])
_check_pandas_roundtrip(df, expected=expected_df, preserve_index=True)


def _fully_loaded_dataframe_example():
from distutils.version import LooseVersion
Expand Down