MCPcopy Create free account
hub / github.com/apache/arrow / test_category_zero_chunks

Method test_category_zero_chunks

python/pyarrow/tests/test_pandas.py:3139–3150  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3137 _check_pandas_roundtrip(df)
3138
3139 def test_category_zero_chunks(self):
3140 # ARROW-5952
3141 for pa_type, dtype in [(pa.string(), 'object'), (pa.int64(), 'int64')]:
3142 a = pa.chunked_array([], pa.dictionary(pa.int8(), pa_type))
3143 result = a.to_pandas()
3144 expected = pd.Categorical([], categories=np.array([], dtype=dtype))
3145 tm.assert_series_equal(pd.Series(result), pd.Series(expected))
3146
3147 table = pa.table({'a': a})
3148 result = table.to_pandas()
3149 expected = pd.DataFrame({'a': expected})
3150 tm.assert_frame_equal(result, expected)
3151
3152 @pytest.mark.parametrize(
3153 "data,error_type",

Callers

nothing calls this directly

Calls 4

chunked_arrayMethod · 0.80
stringMethod · 0.45
dictionaryMethod · 0.45
arrayMethod · 0.45

Tested by

no test coverage detected