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

Function test_datetime

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

Source from the content-addressed store, hash-verified

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