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

Function test_datetime

python/pyarrow/tests/interchange/test_conversion.py:49–58  ·  view source on GitHub ↗
(unit, tz)

Source from the content-addressed store, hash-verified

47@pytest.mark.parametrize("unit", ['s', 'ms', 'us', 'ns'])
48@pytest.mark.parametrize("tz", ['', 'America/New_York', '+07:30', '-04:30'])
49def test_datetime(unit, tz):
50 dt_arr = [dt(2007, 7, 13), dt(2007, 7, 14), None]
51 table = pa.table({"A": pa.array(dt_arr, type=pa.timestamp(unit, tz=tz))})
52 col = table.__dataframe__().get_column_by_name("A")
53
54 assert col.size() == 3
55 assert col.offset == 0
56 assert col.null_count == 1
57 assert col.dtype[0] == DtypeKind.DATETIME
58 assert col.describe_null == (ColumnNullType.USE_BITMASK, 0)
59
60
61@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

get_column_by_nameMethod · 0.80
__dataframe__Method · 0.80
arrayMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected