File tree 1 file changed +23
-0
lines changed
pandas/tests/series/methods
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -120,3 +120,26 @@ def test_combine_first_preserves_dtype(self):
120
120
result = s1 .combine_first (s2 )
121
121
expected = Series ([1666880195890293744 , 1666880195890293837 , 3 ])
122
122
tm .assert_series_equal (result , expected )
123
+
124
+ def test_combine_mixed_timezone (self ):
125
+ # GH 26283
126
+ uniform_tz = Series ({pd .Timestamp ("2019-05-01" , tz = "UTC" ): 1.0 })
127
+ multi_tz = Series (
128
+ {
129
+ pd .Timestamp ("2019-05-01 01:00:00+0100" , tz = "Europe/London" ): 2.0 ,
130
+ pd .Timestamp ("2019-05-02" , tz = "UTC" ): 3.0 ,
131
+ }
132
+ )
133
+
134
+ result = uniform_tz .combine_first (multi_tz )
135
+ expected = Series (
136
+ [1.0 , 3.0 ],
137
+ index = pd .Index (
138
+ [
139
+ pd .Timestamp ("2019-05-01 00:00:00+00:00" , tz = "UTC" ),
140
+ pd .Timestamp ("2019-05-02 00:00:00+00:00" , tz = "UTC" ),
141
+ ],
142
+ dtype = "object" ,
143
+ ),
144
+ )
145
+ tm .assert_series_equal (result , expected )
You can’t perform that action at this time.
0 commit comments