@@ -62,13 +62,18 @@ def test_types_concat_none() -> None:
6262 check (
6363 assert_type (pd .concat ([None , series , df ], axis = 1 ), pd .DataFrame ), pd .DataFrame
6464 )
65+ check (assert_type (pd .concat ([None , series , df ]), pd .DataFrame ), pd .DataFrame )
6566
6667 check (assert_type (pd .concat ({"a" : None , "b" : series }), pd .Series ), pd .Series )
6768 check (assert_type (pd .concat ({"a" : None , "b" : df }), pd .DataFrame ), pd .DataFrame )
6869 check (
6970 assert_type (pd .concat ({"a" : None , "b" : series , "c" : df }, axis = 1 ), pd .DataFrame ),
7071 pd .DataFrame ,
7172 )
73+ check (
74+ assert_type (pd .concat ({"a" : None , "b" : series , "c" : df }), pd .DataFrame ),
75+ pd .DataFrame ,
76+ )
7277
7378 if TYPE_CHECKING_INVALID_USAGE :
7479 # using assert_type as otherwise the second call would not be type-checked
@@ -77,8 +82,8 @@ def test_types_concat_none() -> None:
7782
7883
7984def test_types_concat () -> None :
80- s : pd . Series = pd .Series ([0 , 1 , - 10 ])
81- s2 : pd . Series = pd .Series ([7 , - 5 , 10 ])
85+ s = pd .Series ([0 , 1 , - 10 ])
86+ s2 = pd .Series ([7 , - 5 , 10 ])
8287
8388 check (assert_type (pd .concat ([s , s2 ]), pd .Series ), pd .Series )
8489 check (assert_type (pd .concat ([s , s2 ], axis = 1 ), pd .DataFrame ), pd .DataFrame )
@@ -166,6 +171,9 @@ def test_types_concat() -> None:
166171 adict = {"a" : df , 2 : df2 }
167172 check (assert_type (pd .concat (adict ), pd .DataFrame ), pd .DataFrame )
168173
174+ data : pd .DataFrame | pd .Series = pd .Series ()
175+ check (assert_type (pd .concat ([pd .DataFrame (), data ]), pd .DataFrame ), pd .DataFrame )
176+
169177
170178def test_concat_args () -> None :
171179 df = pd .DataFrame (data = {"col1" : [1 , 2 ], "col2" : [3 , 4 ]})
0 commit comments