File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 20
20
PANDAS_GE_12 = Version (pd .__version__ ) >= Version ("1.2.0" )
21
21
PANDAS_GE_13 = Version (pd .__version__ ) >= Version ("1.3.0" )
22
22
PANDAS_GE_14 = Version (pd .__version__ ) >= Version ("1.4.0rc0" )
23
-
23
+ PANDAS_GE_20 = Version ( pd . __version__ ) >= Version ( "2.0.0.dev0" )
24
24
25
25
# -----------------------------------------------------------------------------
26
26
# Shapely / PyGEOS compat
Original file line number Diff line number Diff line change 16
16
17
17
import geopandas
18
18
from geopandas import GeoDataFrame , read_file
19
+ from geopandas ._compat import PANDAS_GE_20
19
20
from geopandas .io .file import _detect_driver , _EXTENSION_TO_DRIVER
20
21
21
22
from geopandas .testing import assert_geodataframe_equal , assert_geoseries_equal
@@ -309,7 +310,11 @@ def test_read_file_datetime_mixed_offsets(tmpdir):
309
310
if FIONA_GE_1814 :
310
311
# Convert mixed timezones to UTC equivalent
311
312
assert is_datetime64_any_dtype (res ["date" ])
312
- assert res ["date" ].dt .tz == pytz .utc
313
+ if not PANDAS_GE_20 :
314
+ utc = pytz .utc
315
+ else :
316
+ utc = datetime .timezone .utc
317
+ assert res ["date" ].dt .tz == utc
313
318
else :
314
319
# old fiona and pyogrio ignore timezones and read as datetimes successfully
315
320
assert is_datetime64_any_dtype (res ["date" ])
You can’t perform that action at this time.
0 commit comments