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

Function test_extract_datetime_components

python/pyarrow/tests/test_compute.py:2707–2734  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

2705
2706@pytest.mark.pandas
2707def test_extract_datetime_components(request):
2708 timestamps = ["1970-01-01T00:00:59.123456789",
2709 "2000-02-29T23:23:23.999999999",
2710 "2033-05-18T03:33:20.000000000",
2711 "2020-01-01T01:05:05.001",
2712 "2019-12-31T02:10:10.002",
2713 "2019-12-30T03:15:15.003",
2714 "2009-12-31T04:20:20.004132",
2715 "2010-01-01T05:25:25.005321",
2716 "2010-01-03T06:30:30.006163",
2717 "2010-01-04T07:35:35.0",
2718 "2006-01-01T08:40:40.0",
2719 "2005-12-31T09:45:45.0",
2720 "2008-12-28T00:00:00.0",
2721 "2008-12-29T00:00:00.0",
2722 "2012-01-01T01:02:03.0"]
2723 timezones = ["UTC", "America/Chicago", "Asia/Kolkata",
2724 "Etc/GMT-4", "Etc/GMT+4", "Australia/Broken_Hill"]
2725
2726 # Test timezone naive timestamp array
2727 _check_datetime_components(timestamps)
2728
2729 # Test timezone aware timestamp array
2730 if not request.config.pyarrow.is_enabled["timezone_data"]:
2731 pytest.skip('Timezone database is not installed on Windows')
2732 else:
2733 for timezone in timezones:
2734 _check_datetime_components(timestamps, timezone)
2735
2736
2737def test_offset_timezone():

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected