-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG:reorder type check/conversion so wide_to_long handles str arg for… #22490
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
Conversation
This reorders the list type check/conversion to occur before the stubname membership test. This will prevent the ValueError in the cases where a column name is a substring of a stubname when a string is passed to the stubnames argument of wide_to_long(). Also, this is my first PR and I love pandas! |
|
Of course! I can get to those things later this day. Thank you so much for pointing me in the right direction. |
Hello @csmcallister! Thanks for updating the PR.
Comment last updated on September 07, 2018 at 00:48 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #22490 +/- ##
=======================================
Coverage 92.04% 92.04%
=======================================
Files 169 169
Lines 50773 50773
=======================================
Hits 46734 46734
Misses 4039 4039
Continue to review full report at Codecov.
|
@@ -0,0 +1,55 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move existing wide_to_long tests from other reshaping tests to here (in test_melt)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the help on my PR!
I made the style fixes and moved the test to the TestWideToLong class in test_melt.py. I then ran pytest locally and passed. Before updating the PR, I merged master changes from the past few days to my branch doing:
git checkout master
git pull upstream master --ff-only
git checkout my-branch-name
git fetch upstream
git merge upstream/master
There weren't any conflicts, but to be safe I figured I'd run test_melt.py again. That's when I got the following error:
(pandas-dev) Charless-MacBook-Air:reshape mcallistercs$ pytest test_melt.py
Traceback (most recent call last):
File "/Users/mcallistercs/virtualenvs/pandas-dev/lib/python3.6/site-packages/_pytest/config/__init__.py", line 377, in _getconftestmodules
return self._path2confmods[path]
KeyError: local('/Users/mcallistercs/Desktop/Github/pandas-csmcallister/pandas/tests/reshape/test_melt.py')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/mcallistercs/virtualenvs/pandas-dev/lib/python3.6/site-packages/_pytest/config/__init__.py", line 377, in _getconftestmodules
return self._path2confmods[path]
KeyError: local('/Users/mcallistercs/Desktop/Github/pandas-csmcallister/pandas/tests/reshape')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/mcallistercs/virtualenvs/pandas-dev/lib/python3.6/site-packages/_pytest/config/__init__.py", line 408, in _importconftest
return self._conftestpath2mod[conftestpath]
KeyError: local('/Users/mcallistercs/Desktop/Github/pandas-csmcallister/pandas/conftest.py')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/mcallistercs/virtualenvs/pandas-dev/lib/python3.6/site-packages/_pytest/config/__init__.py", line 414, in _importconftest
mod = conftestpath.pyimport()
File "/Users/mcallistercs/virtualenvs/pandas-dev/lib/python3.6/site-packages/py/_path/local.py", line 668, in pyimport
__import__(modname)
File "/Users/mcallistercs/virtualenvs/pandas-dev/lib/python3.6/site-packages/_pytest/assertion/rewrite.py", line 226, in load_module
py.builtin.exec_(co, mod.__dict__)
File "/Users/mcallistercs/Desktop/Github/pandas-csmcallister/pandas/conftest.py", line 458, in <module>
from hypothesis import strategies as st
ModuleNotFoundError: No module named 'hypothesis'
ERROR: could not load /Users/mcallistercs/Desktop/Github/pandas-csmcallister/pandas/conftest.py
I then opened a new shell and pip installed hypothesis, but still received the same error when trying to test again. Any help would be greatly appreciated!
Codecov Report
@@ Coverage Diff @@
## master #22490 +/- ##
==========================================
+ Coverage 92.04% 92.04% +<.01%
==========================================
Files 169 169
Lines 50783 50782 -1
==========================================
+ Hits 46741 46744 +3
+ Misses 4042 4038 -4
Continue to review full report at Codecov.
|
Well, this is embarrassing. Copying and pasting jacked up the indentation and angered pep8speaks. Weird since because beforehand I ran |
looks good. can you rebase on master and push again. ping on green. |
… stubnames. GH22468 DOC:Updating whatsnew (#22468) TST:test bug fix and old functionality (#22468) CLN:complying with PEP8 isssues (#22468) TST: Moved wide_to_long test to test_melt.py and fixed linting issues (#22468) CLN: Adjusted indentation for linting (#22468) CLN: Adjusted spacing for linting (#22468)
Codecov Report
@@ Coverage Diff @@
## master #22490 +/- ##
=======================================
Coverage 92.18% 92.18%
=======================================
Files 169 169
Lines 50820 50820
=======================================
Hits 46850 46850
Misses 3970 3970
Continue to review full report at Codecov.
|
Rebased on master, squashing commits into one. @jreback |
not sue why failing, can you merge master and try again |
Just merged and trying again. |
thanks @csmcallister |
… stubnames. GH22468 (pandas-dev#22490)
closes #22468
git diff upstream/master -u -- "*.py" | flake8 --diff