9
9
infer_dtype_from_scalar ,
10
10
)
11
11
from pandas .core .dtypes .common import is_dtype_equal
12
- from pandas .core .dtypes .dtypes import IntervalDtype , PeriodDtype
12
+ from pandas .core .dtypes .dtypes import DatetimeTZDtype , IntervalDtype , PeriodDtype
13
13
14
14
from pandas import (
15
15
Categorical ,
@@ -205,6 +205,10 @@ def test_cast_scalar_to_numpy_array(obj, dtype):
205
205
[
206
206
(Period ("2011-01-01" , freq = "D" ), PeriodDtype ("D" )),
207
207
(Interval (left = 0 , right = 5 ), IntervalDtype ("int64" )),
208
+ (
209
+ Timestamp ("2011-01-01" , tz = "US/Eastern" ),
210
+ DatetimeTZDtype (unit = "ns" , tz = "US/Eastern" ),
211
+ ),
208
212
],
209
213
)
210
214
def test_cast_scalar_to_extension_array (obj , dtype ):
@@ -215,3 +219,6 @@ def test_cast_scalar_to_extension_array(obj, dtype):
215
219
216
220
arr = cast_scalar_to_array (shape , obj , dtype = dtype )
217
221
tm .assert_extension_array_equal (arr [0 ], exp )
222
+
223
+ arr = cast_scalar_to_array (shape , obj , dtype = None )
224
+ tm .assert_extension_array_equal (arr [0 ], exp )
0 commit comments