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

Function test_date_cast

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

Source from the content-addressed store, hash-verified

311
312
313def test_date_cast():
314 # ARROW-10472 - casting fo scalars doesn't segfault
315 scalar = pa.scalar(datetime.datetime(2012, 1, 1), type=pa.timestamp("us"))
316 expected = datetime.date(2012, 1, 1)
317 for ty in [pa.date32(), pa.date64()]:
318 result = scalar.cast(ty)
319 assert result.as_py() == expected
320
321
322def test_time_from_datetime_time():

Callers

nothing calls this directly

Calls 5

datetimeMethod · 0.80
as_pyMethod · 0.80
scalarMethod · 0.45
dateMethod · 0.45
castMethod · 0.45

Tested by

no test coverage detected