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

Function test_cast_timestamp_to_string

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

Source from the content-addressed store, hash-verified

375
376@pytest.mark.timezone_data
377def test_cast_timestamp_to_string():
378 # GH-35370
379 pytest.importorskip("pytz")
380 import pytz
381 dt = datetime.datetime(2000, 1, 1, 0, 0, 0, tzinfo=pytz.utc)
382 ts = pa.scalar(dt, type=pa.timestamp("ns", tz="UTC"))
383 assert ts.cast(pa.string()) == pa.scalar('2000-01-01 00:00:00.000000000Z')
384
385
386def test_cast_float_to_int():

Callers

nothing calls this directly

Calls 4

datetimeMethod · 0.80
scalarMethod · 0.45
castMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected