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

Function test_extract_datetime_components

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

Source from the content-addressed store, hash-verified

2550
2551@pytest.mark.pandas
2552def test_extract_datetime_components(request):
2553 timestamps = ["1970-01-01T00:00:59.123456789",
2554 "2000-02-29T23:23:23.999999999",
2555 "2033-05-18T03:33:20.000000000",
2556 "2020-01-01T01:05:05.001",
2557 "2019-12-31T02:10:10.002",
2558 "2019-12-30T03:15:15.003",
2559 "2009-12-31T04:20:20.004132",
2560 "2010-01-01T05:25:25.005321",
2561 "2010-01-03T06:30:30.006163",
2562 "2010-01-04T07:35:35.0",
2563 "2006-01-01T08:40:40.0",
2564 "2005-12-31T09:45:45.0",
2565 "2008-12-28T00:00:00.0",
2566 "2008-12-29T00:00:00.0",
2567 "2012-01-01T01:02:03.0"]
2568 timezones = ["UTC", "America/Chicago", "Asia/Kolkata",
2569 "Etc/GMT-4", "Etc/GMT+4", "Australia/Broken_Hill"]
2570
2571 # Test timezone naive timestamp array
2572 _check_datetime_components(timestamps)
2573
2574 # Test timezone aware timestamp array
2575 if not request.config.pyarrow.is_enabled["timezone_data"]:
2576 pytest.skip('Timezone database is not installed on Windows')
2577 else:
2578 for timezone in timezones:
2579 _check_datetime_components(timestamps, timezone)
2580
2581
2582def test_offset_timezone():

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected