File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
pandas/tests/extension/base Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
import numpy as np
2
2
import pytest
3
3
4
+ import pandas .util ._test_decorators as td
5
+
4
6
import pandas as pd
5
7
from pandas .core .internals import ObjectBlock
6
8
from pandas .tests .extension .base .base import BaseExtensionTests
@@ -43,8 +45,19 @@ def test_astype_str(self, data):
43
45
expected = pd .Series ([str (x ) for x in data [:5 ]], dtype = str )
44
46
self .assert_series_equal (result , expected )
45
47
48
+ @pytest .mark .parametrize (
49
+ "nullable_string_dtype" ,
50
+ [
51
+ "string" ,
52
+ pytest .param (
53
+ "arrow_string" , marks = td .skip_if_no ("pyarrow" , min_version = "1.0.0" )
54
+ ),
55
+ ],
56
+ )
46
57
def test_astype_string (self , data , nullable_string_dtype ):
47
58
# GH-33465
59
+ from pandas .core .arrays .string_arrow import ArrowStringDtype # noqa: F401
60
+
48
61
result = pd .Series (data [:5 ]).astype (nullable_string_dtype )
49
62
expected = pd .Series ([str (x ) for x in data [:5 ]], dtype = nullable_string_dtype )
50
63
self .assert_series_equal (result , expected )
You can’t perform that action at this time.
0 commit comments