Skip to content

Conversation

makbigc
Copy link
Contributor

@makbigc makbigc commented Jun 15, 2019

Follow up #26225 (review)

@codecov
Copy link

codecov bot commented Jun 15, 2019

Codecov Report

Merging #26870 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26870      +/-   ##
==========================================
- Coverage   91.87%   91.86%   -0.01%     
==========================================
  Files         180      180              
  Lines       50716    50716              
==========================================
- Hits        46594    46590       -4     
- Misses       4122     4126       +4
Flag Coverage Δ
#multiple 90.45% <100%> (ø) ⬆️
#single 41.1% <100%> (-0.09%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/interval.py 96.44% <100%> (ø) ⬆️
pandas/io/gbq.py 88.88% <0%> (-11.12%) ⬇️
pandas/core/frame.py 96.88% <0%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d432f65...9f485c3. Read the comment docs.

@Appender(_index_shared_docs['intersection'])
@SetopCheck(op_name='intersection')
def intersection(self, other, sort=False):
def intersection(self, other, sort: bool = False):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add typing on other? (and do this for all the intersection calls)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did try something as follows in HEAD~1:

    def intersection(self,
                     other: IntervalIndex,
                     sort: bool = False
                     ) -> IntervalIndex:

But this will run into the NameError, i.e.,
NameError: name 'IntervalIndex' is not defined

Copy link
Contributor

Choose a reason for hiding this comment

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

use the string Intervalndex and this will work

@jreback jreback added the Typing type annotations, mypy/pyright type checking label Jun 16, 2019
@Appender(_index_shared_docs['intersection'])
@SetopCheck(op_name='intersection')
def intersection(self, other, sort=False):
def intersection(self,
Copy link
Contributor

Choose a reason for hiding this comment

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

typing nitpick, we use single quotes on these annotations, otherwise lgtm. ping on green.

@WillAyd can we systematically check this?

@jreback jreback added this to the 0.25.0 milestone Jun 17, 2019
@jreback jreback merged commit 7375c73 into pandas-dev:master Jun 18, 2019
@jreback
Copy link
Contributor

jreback commented Jun 18, 2019

thanks @makbigc

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.

2 participants