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

Function test_cast

python/pyarrow/tests/test_scalars.py:367–373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

365
366
367def test_cast():
368 val = pa.scalar(5, type='int8')
369 assert val.cast('int64') == pa.scalar(5, type='int64')
370 assert val.cast('uint32') == pa.scalar(5, type='uint32')
371 assert val.cast('string') == pa.scalar('5', type='string')
372 with pytest.raises(ValueError):
373 pa.scalar('foo').cast('int32')
374
375
376@pytest.mark.timezone_data

Callers

nothing calls this directly

Calls 2

scalarMethod · 0.45
castMethod · 0.45

Tested by

no test coverage detected