(unit)
| 2802 | "second", "minute", "hour", "day")) |
| 2803 | @pytest.mark.pandas |
| 2804 | def test_round_temporal(unit): |
| 2805 | values = (1, 2, 3, 4, 5, 6, 7, 10, 15, 24, 60, 250, 500, 750) |
| 2806 | timestamps = [ |
| 2807 | "1923-07-07 08:52:35.203790336", |
| 2808 | "1931-03-17 10:45:00.641559040", |
| 2809 | "1932-06-16 01:16:42.911994368", |
| 2810 | "1941-05-27 11:46:43.822831872", |
| 2811 | "1943-12-14 07:32:05.424766464", |
| 2812 | "1954-04-12 04:31:50.699881472", |
| 2813 | "1966-02-12 17:41:28.693282560", |
| 2814 | "1967-02-26 05:56:46.922376960", |
| 2815 | "1975-11-01 10:55:37.016146432", |
| 2816 | "1982-01-21 18:43:44.517366784", |
| 2817 | "1992-01-01 00:00:00.100000000", |
| 2818 | "1999-12-04 05:55:34.794991104", |
| 2819 | "2026-10-26 08:39:00.316686848"] |
| 2820 | |
| 2821 | # Windows timezone database appears to disagree with IANA timezone database on |
| 2822 | # some historical timestamps. We exclude those timestamps from testing on Windows. |
| 2823 | # Specifically removing: |
| 2824 | # "1941-05-27 11:46:43.822831872" and "1943-12-14 07:32:05.424766464" |
| 2825 | if sys.platform == "win32": |
| 2826 | timestamps = timestamps[:3] + timestamps[5:] |
| 2827 | |
| 2828 | ts = pd.Series([pd.Timestamp(x, unit="ns") for x in timestamps]) |
| 2829 | _check_temporal_rounding(ts, values, unit) |
| 2830 | |
| 2831 | timezones = ["Asia/Kolkata", "America/New_York", "Etc/GMT-4", "Etc/GMT+4", |
| 2832 | "Europe/Brussels", "Pacific/Marquesas", "America/Chicago", "UTC"] |
| 2833 | |
| 2834 | for timezone in timezones: |
| 2835 | ts_zoned = ts.dt.tz_localize("UTC").dt.tz_convert(timezone) |
| 2836 | _check_temporal_rounding(ts_zoned, values, unit) |
| 2837 | |
| 2838 | |
| 2839 | def test_count(): |
nothing calls this directly
no test coverage detected