@@ -1238,16 +1238,17 @@ def test_types_as_type() -> None:
1238
1238
1239
1239
1240
1240
def test_types_dot () -> None :
1241
+ """Test typing of multiplication methods (dot and @) for Series."""
1241
1242
s1 = pd .Series ([0 , 1 , 2 , 3 ])
1242
1243
s2 = pd .Series ([- 1 , 2 , - 3 , 4 ])
1243
1244
df1 = pd .DataFrame ([[0 , 1 ], [- 2 , 3 ], [4 , - 5 ], [6 , 7 ]])
1244
1245
n1 = np .array ([[0 , 1 ], [1 , 2 ], [- 1 , - 1 ], [2 , 0 ]])
1245
- sc1 : Scalar = s1 .dot (s2 )
1246
- sc2 : Scalar = s1 @ s2
1247
- s3 : pd .Series = s1 . dot ( df1 )
1248
- s4 : pd . Series = s1 @ df1
1249
- n2 : np .ndarray = s1 . dot ( n1 )
1250
- n3 : np . ndarray = s1 @ n1
1246
+ check ( assert_type ( s1 .dot (s2 ), Scalar ), np . int64 )
1247
+ check ( assert_type ( s1 @ s2 , Scalar ), np . int64 )
1248
+ check ( assert_type ( s1 . dot ( df1 ), " pd.Series[int]" ), pd . Series , np . int64 )
1249
+ check ( assert_type ( s1 @ df1 , pd . Series ), pd . Series )
1250
+ check ( assert_type ( s1 . dot ( n1 ), np .ndarray ), np . ndarray )
1251
+ check ( assert_type ( s1 @ n1 , np . ndarray ), np . ndarray )
1251
1252
1252
1253
1253
1254
def test_series_loc_setitem () -> None :
0 commit comments