@@ -173,7 +173,8 @@ def test_mixed_dataset_scalar_vector():
173173 class aDatasetVectorScalar (af .Dataset ):
174174 """A well-documented dataset."""
175175
176- v1 = af .Vector (np .str_ , comment = "first" )
176+ # str dtype works in both pandas v2 and v3, np.str_ only in v2
177+ v1 = af .Vector ("str" , comment = "first" )
177178 v2 = af .Scalar (np .int8 , comment = "second" )
178179 v3 = af .VectorF16 ("third" )
179180
@@ -196,12 +197,12 @@ class aDatasetVectorScalar(af.Dataset):
196197 assert data1 .metadata .get ("table_comment" ) == "A well-documented dataset."
197198 assert data1 .metadata .get ("source" ) == "manual"
198199 expected_df = pd .DataFrame ({"v1" : list ("abcdef" ), "v2" : 2 , "v3" : range (6 )}).astype (
199- {"v1" : np . str_ , "v2" : np .int8 , "v3" : np .float16 }
200+ {"v1" : "str" , "v2" : np .int8 , "v3" : np .float16 }
200201 )
201202 pd .testing .assert_frame_equal (data1 .df , expected_df )
202203
203204 class aDatasetOnlyVector (af .Dataset ):
204- v1 = af .Vector (np . str_ , comment = "first" )
205+ v1 = af .Vector ("str" , comment = "first" )
205206 v2 = af .Vector (np .int8 , comment = "second" )
206207 v3 = af .VectorF16 ("third" )
207208
0 commit comments