Skip to content

Conversation

lukasbk
Copy link
Contributor

@lukasbk lukasbk commented Oct 12, 2019

Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

@lukasbk Thanks for the PR. minor comments.

frame_scalar_exc = TypeError
series_array_exc = TypeError
divmod_exc = TypeError
series_scalar_exc = TypeError # type: Union[Type[Exception], None]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
series_scalar_exc = TypeError # type: Union[Type[Exception], None]
series_scalar_exc = TypeError # type: Optional[Type[TypeError]]

I think we don't need to be more permissive on the error type here.

also, we tend to use Optional[<type>] instead of Union[<type>, None]

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Oct 12, 2019
@simonjayhawkins
Copy link
Member

does this also fix the errors in pandas\tests\extension\test_sparse

@simonjayhawkins simonjayhawkins added this to the 1.0 milestone Oct 12, 2019
Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

@WillAyd WillAyd merged commit 625c550 into pandas-dev:master Oct 13, 2019
@WillAyd
Copy link
Member

WillAyd commented Oct 13, 2019

Great thanks @lukasbk !

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