@@ -145,3 +145,29 @@ def test_to_numpy_pandas_series_numpy_dtypes_numeric(dtype, supported):
145
145
result = _to_numpy (series )
146
146
_check_result (result , supported )
147
147
npt .assert_array_equal (result , series )
148
+
149
+
150
+ @pytest .mark .parametrize (
151
+ ("dtype" , "supported" ),
152
+ [
153
+ pytest .param (pd .Int8Dtype (), True , id = "Int8" ),
154
+ pytest .param (pd .Int16Dtype (), True , id = "Int16" ),
155
+ pytest .param (pd .Int32Dtype (), True , id = "Int32" ),
156
+ pytest .param (pd .Int64Dtype (), True , id = "Int64" ),
157
+ pytest .param (pd .UInt8Dtype (), True , id = "UInt8" ),
158
+ pytest .param (pd .UInt16Dtype (), True , id = "UInt16" ),
159
+ pytest .param (pd .UInt32Dtype (), True , id = "UInt32" ),
160
+ pytest .param (pd .UInt64Dtype (), True , id = "UInt64" ),
161
+ pytest .param (pd .Float32Dtype (), True , id = "Float32" ),
162
+ pytest .param (pd .Float64Dtype (), True , id = "Float64" ),
163
+ ],
164
+ )
165
+ def test_to_numpy_pandas_series_pandas_dtypes_numeric (dtype , supported ):
166
+ """
167
+ Test the _to_numpy function with pandas.Series of pandas numeric dtypes.
168
+ """
169
+ series = pd .Series ([1 , 2 , 3 ], dtype = dtype )
170
+ assert series .dtype == dtype
171
+ result = _to_numpy (series )
172
+ _check_result (result , supported )
173
+ npt .assert_array_equal (result , series )
0 commit comments