|
31 | 31 | import time |
32 | 32 | import uuid |
33 | 33 | from collections.abc import Generator |
34 | | -from datetime import date, datetime, timezone |
| 34 | +from datetime import UTC, date, datetime |
35 | 35 | from pathlib import Path |
36 | 36 | from random import choice, randint |
37 | 37 | from tempfile import TemporaryDirectory |
@@ -2783,9 +2783,9 @@ def spark() -> "SparkSession": |
2783 | 2783 | # 'time': [1_000_000, None, 3_000_000], # Example times: 1s, none, and 3s past midnight #Spark does not support time fields |
2784 | 2784 | "timestamp": [datetime(2023, 1, 1, 19, 25, 00), None, datetime(2023, 3, 1, 19, 25, 00)], |
2785 | 2785 | "timestamptz": [ |
2786 | | - datetime(2023, 1, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2786 | + datetime(2023, 1, 1, 19, 25, 00, tzinfo=UTC), |
2787 | 2787 | None, |
2788 | | - datetime(2023, 3, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2788 | + datetime(2023, 3, 1, 19, 25, 00, tzinfo=UTC), |
2789 | 2789 | ], |
2790 | 2790 | "date": [date(2023, 1, 1), None, date(2023, 3, 1)], |
2791 | 2791 | # Not supported by Spark |
@@ -2849,9 +2849,9 @@ def arrow_table_with_null(pa_schema: "pa.Schema") -> "pa.Table": |
2849 | 2849 | # Spark does not support time fields |
2850 | 2850 | "timestamp": [datetime(2023, 1, 1, 19, 25, 00), None, datetime(2023, 3, 1, 19, 25, 00)], |
2851 | 2851 | "timestamptz": [ |
2852 | | - datetime(2023, 1, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2852 | + datetime(2023, 1, 1, 19, 25, 00, tzinfo=UTC), |
2853 | 2853 | None, |
2854 | | - datetime(2023, 3, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2854 | + datetime(2023, 3, 1, 19, 25, 00, tzinfo=UTC), |
2855 | 2855 | ], |
2856 | 2856 | "date": [date(2023, 1, 1), None, date(2023, 3, 1)], |
2857 | 2857 | # Not supported by Spark |
@@ -2903,11 +2903,11 @@ def arrow_table_date_timestamps() -> "pa.Table": |
2903 | 2903 | None, |
2904 | 2904 | ], |
2905 | 2905 | "timestamptz": [ |
2906 | | - datetime(2023, 12, 31, 0, 0, 0, tzinfo=timezone.utc), |
2907 | | - datetime(2024, 1, 1, 0, 0, 0, tzinfo=timezone.utc), |
2908 | | - datetime(2024, 1, 31, 0, 0, 0, tzinfo=timezone.utc), |
2909 | | - datetime(2024, 2, 1, 0, 0, 0, tzinfo=timezone.utc), |
2910 | | - datetime(2024, 2, 1, 6, 0, 0, tzinfo=timezone.utc), |
| 2906 | + datetime(2023, 12, 31, 0, 0, 0, tzinfo=UTC), |
| 2907 | + datetime(2024, 1, 1, 0, 0, 0, tzinfo=UTC), |
| 2908 | + datetime(2024, 1, 31, 0, 0, 0, tzinfo=UTC), |
| 2909 | + datetime(2024, 2, 1, 0, 0, 0, tzinfo=UTC), |
| 2910 | + datetime(2024, 2, 1, 6, 0, 0, tzinfo=UTC), |
2911 | 2911 | None, |
2912 | 2912 | ], |
2913 | 2913 | }, |
@@ -2963,46 +2963,46 @@ def arrow_table_with_all_timestamp_precisions(arrow_table_schema_with_all_timest |
2963 | 2963 | { |
2964 | 2964 | "timestamp_s": [datetime(2023, 1, 1, 19, 25, 00), None, datetime(2023, 3, 1, 19, 25, 00)], |
2965 | 2965 | "timestamptz_s": [ |
2966 | | - datetime(2023, 1, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2966 | + datetime(2023, 1, 1, 19, 25, 00, tzinfo=UTC), |
2967 | 2967 | None, |
2968 | | - datetime(2023, 3, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2968 | + datetime(2023, 3, 1, 19, 25, 00, tzinfo=UTC), |
2969 | 2969 | ], |
2970 | 2970 | "timestamp_ms": [datetime(2023, 1, 1, 19, 25, 00), None, datetime(2023, 3, 1, 19, 25, 00)], |
2971 | 2971 | "timestamptz_ms": [ |
2972 | | - datetime(2023, 1, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2972 | + datetime(2023, 1, 1, 19, 25, 00, tzinfo=UTC), |
2973 | 2973 | None, |
2974 | | - datetime(2023, 3, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2974 | + datetime(2023, 3, 1, 19, 25, 00, tzinfo=UTC), |
2975 | 2975 | ], |
2976 | 2976 | "timestamp_us": [datetime(2023, 1, 1, 19, 25, 00), None, datetime(2023, 3, 1, 19, 25, 00)], |
2977 | 2977 | "timestamptz_us": [ |
2978 | | - datetime(2023, 1, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2978 | + datetime(2023, 1, 1, 19, 25, 00, tzinfo=UTC), |
2979 | 2979 | None, |
2980 | | - datetime(2023, 3, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2980 | + datetime(2023, 3, 1, 19, 25, 00, tzinfo=UTC), |
2981 | 2981 | ], |
2982 | 2982 | "timestamp_ns": [ |
2983 | 2983 | pd.Timestamp(year=2024, month=7, day=11, hour=3, minute=30, second=0, microsecond=12, nanosecond=6), |
2984 | 2984 | None, |
2985 | 2985 | pd.Timestamp(year=2024, month=7, day=11, hour=3, minute=30, second=0, microsecond=12, nanosecond=7), |
2986 | 2986 | ], |
2987 | 2987 | "timestamptz_ns": [ |
2988 | | - datetime(2023, 1, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2988 | + datetime(2023, 1, 1, 19, 25, 00, tzinfo=UTC), |
2989 | 2989 | None, |
2990 | | - datetime(2023, 3, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2990 | + datetime(2023, 3, 1, 19, 25, 00, tzinfo=UTC), |
2991 | 2991 | ], |
2992 | 2992 | "timestamptz_us_etc_utc": [ |
2993 | | - datetime(2023, 1, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2993 | + datetime(2023, 1, 1, 19, 25, 00, tzinfo=UTC), |
2994 | 2994 | None, |
2995 | | - datetime(2023, 3, 1, 19, 25, 00, tzinfo=timezone.utc), |
| 2995 | + datetime(2023, 3, 1, 19, 25, 00, tzinfo=UTC), |
2996 | 2996 | ], |
2997 | 2997 | "timestamptz_ns_z": [ |
2998 | 2998 | pd.Timestamp(year=2024, month=7, day=11, hour=3, minute=30, second=0, microsecond=12, nanosecond=6, tz="UTC"), |
2999 | 2999 | None, |
3000 | 3000 | pd.Timestamp(year=2024, month=7, day=11, hour=3, minute=30, second=0, microsecond=12, nanosecond=7, tz="UTC"), |
3001 | 3001 | ], |
3002 | 3002 | "timestamptz_s_0000": [ |
3003 | | - datetime(2023, 1, 1, 19, 25, 1, tzinfo=timezone.utc), |
| 3003 | + datetime(2023, 1, 1, 19, 25, 1, tzinfo=UTC), |
3004 | 3004 | None, |
3005 | | - datetime(2023, 3, 1, 19, 25, 1, tzinfo=timezone.utc), |
| 3005 | + datetime(2023, 3, 1, 19, 25, 1, tzinfo=UTC), |
3006 | 3006 | ], |
3007 | 3007 | } |
3008 | 3008 | ) |
|
0 commit comments