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

Function test_cast_float_to_int

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

Source from the content-addressed store, hash-verified

384
385
386def test_cast_float_to_int():
387 # GH-35040
388 float_scalar = pa.scalar(1.5, type=pa.float64())
389 unsafe_cast = float_scalar.cast(pa.int64(), safe=False)
390 expected_unsafe_cast = pa.scalar(1, type=pa.int64())
391 assert unsafe_cast == expected_unsafe_cast
392 with pytest.raises(pa.ArrowInvalid):
393 float_scalar.cast(pa.int64()) # verify default is safe cast
394
395
396def test_cast_int_to_float():

Callers

nothing calls this directly

Calls 2

scalarMethod · 0.45
castMethod · 0.45

Tested by

no test coverage detected