Closed
Description
Describe the bug
concat
with None
values are valid use but pandas-stubs rejects.
To Reproduce
- Provide a minimal runnable
pandas
example that is not properly checked by the stubs.
def x() -> pd.DataFrame:
df1: pd.DataFrame | None = None
df2 = pd.DataFrame()
return pd.concat([df1, df2])
- Using mypy
- Error
List item 0 has incompatible type "DataFrame | None"; expected "DataFrame" [list-item]
Please complete the following information:
- OS: Fedora
- OS Version 7.8
- python version 3.11.7
- version of type checker 1.8.0
- version of installed
pandas-stubs
2.1.1