Skip to content

BUG: cast to correct dtype in Index.drop() #18309

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
Dec 29, 2017

Conversation

toobaz
Copy link
Member

@toobaz toobaz commented Nov 15, 2017

@codecov
Copy link

codecov bot commented Nov 15, 2017

Codecov Report

Merging #18309 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18309      +/-   ##
==========================================
- Coverage   91.39%   91.38%   -0.02%     
==========================================
  Files         164      164              
  Lines       49854    49855       +1     
==========================================
- Hits        45566    45558       -8     
- Misses       4288     4297       +9
Flag Coverage Δ
#multiple 89.18% <100%> (ø) ⬆️
#single 39.44% <100%> (-0.06%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/base.py 96.42% <100%> (ø) ⬆️
pandas/core/common.py 93% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.8% <0%> (-0.1%) ⬇️

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 9c799e2...7614bf3. Read the comment docs.

@codecov
Copy link

codecov bot commented Nov 15, 2017

Codecov Report

Merging #18309 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18309      +/-   ##
==========================================
+ Coverage    91.6%   91.61%   +<.01%     
==========================================
  Files         150      150              
  Lines       48939    48940       +1     
==========================================
+ Hits        44833    44834       +1     
  Misses       4106     4106
Flag Coverage Δ
#multiple 89.97% <100%> (ø) ⬆️
#single 41.17% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/common.py 92.92% <100%> (ø) ⬆️
pandas/core/indexes/base.py 96.45% <100%> (ø) ⬆️

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 dbec3c9...7fea97a. Read the comment docs.

@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Nov 16, 2017
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

can you add the test from the original issue. (crosstab), lgtm. otherwise.

@@ -404,7 +404,7 @@ def _asarray_tuplesafe(values, dtype=None):
return result


def _index_labels_to_array(labels):
def _index_labels_to_array(labels, dtype=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

doc-string here would be nice; in theory some unit tests if you can.

Copy link
Member Author

Choose a reason for hiding this comment

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

docstring added; this is tested in my new test and, in old tests, whenever Index(dtype='object').drop() is called.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am asking for some unit-tests for this routine itself. all of these helper routines should ideally have tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Uhm... unless there are specific coverage (lines of code) issues, I personally don't see this as an efficient use of my time, considering how many and how frequently changed are pandas internal routines.

@@ -404,7 +404,7 @@ def _asarray_tuplesafe(values, dtype=None):
return result


def _index_labels_to_array(labels):
def _index_labels_to_array(labels, dtype=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

I am asking for some unit-tests for this routine itself. all of these helper routines should ideally have tests.

@jreback
Copy link
Contributor

jreback commented Dec 28, 2017

can you rebase

@jreback jreback added this to the 0.23.0 milestone Dec 29, 2017
@jreback jreback merged commit 4883a43 into pandas-dev:master Dec 29, 2017
@jreback
Copy link
Contributor

jreback commented Dec 29, 2017

thanks @toobaz

@toobaz toobaz deleted the index_drop_tuple branch December 29, 2017 08:35
hexgnu pushed a commit to hexgnu/pandas that referenced this pull request Jan 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd.Index([ ('b', 'c'), 'a']).drop(['a', ('b', 'c')]) raises ValueError
2 participants