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

Method test_partial_schema

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

Source from the content-addressed store, hash-verified

3223 _check_series(pd.Series([None, np.nan, None], dtype=object))
3224
3225 def test_partial_schema(self):
3226 data = OrderedDict([
3227 ('a', [0, 1, 2, 3, 4]),
3228 ('b', np.array([-10, -5, 0, 5, 10], dtype=np.int32)),
3229 ('c', [-10, -5, 0, 5, 10])
3230 ])
3231 df = pd.DataFrame(data)
3232
3233 partial_schema = pa.schema([
3234 pa.field('c', pa.int64()),
3235 pa.field('a', pa.int64())
3236 ])
3237
3238 _check_pandas_roundtrip(df, schema=partial_schema,
3239 expected=df[['c', 'a']],
3240 expected_schema=partial_schema)
3241
3242 def test_table_batch_empty_dataframe(self):
3243 df = pd.DataFrame({})

Callers

nothing calls this directly

Calls 4

_check_pandas_roundtripFunction · 0.70
arrayMethod · 0.45
schemaMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected