We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 585a220 commit 4db1322Copy full SHA for 4db1322
pandas/tests/frame/test_analytics.py
@@ -1285,3 +1285,16 @@ def test_min_max_dt64_api_consistency_empty_df(self):
1285
# check axis 1
1286
tm.assert_series_equal(df.min(axis=1), expected_float_series)
1287
1288
+
1289
+ @pytest.mark.parametrize(
1290
+ "initial",
1291
+ ["2018-10-08 13:36:45+00:00", "2018-10-08 13:36:45+03:00"], # Non-UTC timezone
1292
+ )
1293
+ @pytest.mark.parametrize("method", ["min", "max"])
1294
+ def test_preserve_timezone(self, initial: str, method):
1295
+ # GH 28552
1296
+ initial_dt = pd.to_datetime(initial)
1297
+ expected = Series([initial_dt])
1298
+ df = DataFrame([expected])
1299
+ result = getattr(df, method)(axis=1)
1300
+ tm.assert_series_equal(result, expected)
0 commit comments