Skip to content

TYP: check_untyped_defs core.reshape.reshape #31367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 31, 2020

Conversation

simonjayhawkins
Copy link
Member

pandas\core\reshape\reshape.py:378: error: "Index" has no attribute "levels"; maybe "nlevels"?
pandas\core\reshape\reshape.py:381: error: "Index" has no attribute "codes"
pandas\core\reshape\reshape.py:383: error: "Index" has no attribute "codes"
pandas\core\reshape\reshape.py:436: error: Incompatible types in assignment (expression has type "_Unstacker", variable has type "partial[_Unstacker]")
pandas\core\reshape\reshape.py:444: error: "partial[_Unstacker]" has no attribute "get_result"
pandas\core\reshape\reshape.py:1000: error: Incompatible types in assignment (expression has type "None", variable has type "Index")
pandas\core\reshape\reshape.py:1009: error: Incompatible types in assignment (expression has type "float", variable has type "int")
pandas\core\reshape\reshape.py:1013: error: Need type annotation for 'sp_indices'

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Jan 27, 2020
if isinstance(data, Series):
index = data.index
else:
index = None

if sparse:

fill_value: Union[bool, float]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be int?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, int is a structural subtype of float and hence the assignment on L1008 is valid for mypy.

@jreback jreback added this to the 1.1 milestone Jan 28, 2020
@jreback jreback merged commit 497c564 into pandas-dev:master Jan 31, 2020
@jreback
Copy link
Contributor

jreback commented Jan 31, 2020

thanks

@simonjayhawkins simonjayhawkins deleted the core.reshape.reshape branch January 31, 2020 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants