-
-
Notifications
You must be signed in to change notification settings - Fork 156
Closed
Labels
Numeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operationsStringsString extension data type and string dataString extension data type and string data
Description
To Reproduce
- Provide a minimal runnable
pandasexample that is not properly checked by the stubs.
from pathlib import Path
import pandas as pd
folder = Path.cwd()
files = pd.Series(["a.png", "b.png"])
# reveal_type(files) # good: Series!
paths = folder / files
# reveal_type(paths) # bad: pathlib.Path!
good_paths = [f if f.is_file() else pd.NA for f in paths]
print(paths)
print(good_paths)-
Indicate which type checker you are using (
mypyorpyright).
mypy 1.2.0 (compiled: yes) -
Show the error message received from that type checker while checking your example.
bug.py:10: error: "Path" has no attribute "__iter__"; maybe "__enter__"? (not iterable) [attr-defined]
Found 1 error in 1 file (checked 1 source file)
Please complete the following information:
- OS: Windows 11
- OS Version: 22H2
- python version: 3.10.11
- version of type checker: 1.2.0
- version of installed
pandas-stubs: 2.0.1.230501
Metadata
Metadata
Assignees
Labels
Numeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operationsStringsString extension data type and string dataString extension data type and string data