You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpandasaspd# Overly restrictive types set, expect errors to not be raisedpd.options.display.max_columns=Nonepd.options.display.max_colwidth=Nonepd.options.display.max_dir_items=Nonepd.options.display.max_rows=Nonepd.options.display.max_seq_items=Nonepd.options.display.min_rows=None# Overly permissive values permitted, expect errors to be raisedpd.options.display.colheader_justify="invalid_value"pd.options.display.large_repr="invalid_value"pd.options.display.memory_usage="invalid_value"pd.options.display.show_dimensions="invalid_value"
test.py:4: error: Incompatible types in assignment (expression has type "None", variable has type "int") [assignment]
pd.options.display.max_columns = None
^~~~
test.py:5: error: Incompatible types in assignment (expression has type "None", variable has type "int") [assignment]
pd.options.display.max_colwidth = None
^~~~
test.py:6: error: Incompatible types in assignment (expression has type "None", variable has type "int") [assignment]
pd.options.display.max_dir_items = None
^~~~
test.py:7: error: Incompatible types in assignment (expression has type "None", variable has type "int") [assignment]
pd.options.display.max_rows = None
^~~~
test.py:8: error: Incompatible types in assignment (expression has type "None", variable has type "int") [assignment]
pd.options.display.max_seq_items = None
^~~~
test.py:9: error: Incompatible types in assignment (expression has type "None", variable has type "int") [assignment]
pd.options.display.min_rows = None
^~~~
test.py:14: error: Incompatible types in assignment (expression has type "str", variable has type "bool") [assignment]
pd.options.display.memory_usage = "invalid_value"
^~~~~~~~~~~~~~~
Found 7 errors in 1 file (checked 1 source file)
Please complete the following information:
OS: MacOS
OS Version: 15.5
python version: 3.12
pandas version: 2.2.3
version of type checker: mypy 1.9.0
version of installed pandas-stubs: 2.2.3.250308
Additional context
I'm happy to do PR, just let me know if that's preferred
The text was updated successfully, but these errors were encountered:
Thanks for the report you are entirely correct the annotations are overly strict beyond the types from the pandas repo. It would be good to realign with types recommended in the docs pandas/core/config_init.py.
PR with tests is welcome, feel free to take it otherwise I am happy to take care of it.
Describe the bug
Various display options underneath
pd.options.display.
do not have correct annotations per pandas documentation.The following columns show mismatches between documented behavior compared to type check:
To Reproduce
Please complete the following information:
pandas-stubs
: 2.2.3.250308Additional context
I'm happy to do PR, just let me know if that's preferred
The text was updated successfully, but these errors were encountered: