-
Notifications
You must be signed in to change notification settings - Fork 173
[ENH] add preserve_position kwarg to deconcatenate_column #478 #484
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
[ENH] add preserve_position kwarg to deconcatenate_column #478 #484
Conversation
Check out this pull request on ReviewNB: https://app.reviewnb.com/ericmjl/pyjanitor/pull/484 You'll be able to see visual diffs and write comments on notebook cells. Powered by ReviewNB. |
Codecov Report
@@ Coverage Diff @@
## dev #484 +/- ##
==========================================
+ Coverage 92.52% 92.61% +0.09%
==========================================
Files 9 9
Lines 789 799 +10
==========================================
+ Hits 730 740 +10
Misses 59 59 |
Oh wow, my apologies--yet to find my way in testing and not yet sure about what is causing the reduction in testing coverage and what remedies I should make. @ericmjl also have additional questions regarding tests:
I added tests but not certain if my approach is proper. Will dig deeper into TDD but if you have recommendations/suggestions, please let me know. Thanks!! |
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 this PR, @shandou! I've given my review over the code, and I think it's in the right frame of mind, just needs a few touches on the structure of the test and on docstrings. After that, I think it'll be ready to merge.
Regarding your questions on tests, here’s my answers:
It is found in
I would focus on getting the core functionality as well-tested as you can. I’m not worried about coverage as much as getting the test expressing the right thing.
Yes! To do so, at the command line, run:
The
|
@ericmjl I made the changes and docs render correctly. When you have a chance please review and let me know if anything else could be improved. Also, thank you so much for all the suggestions and answers! Another side note about the notebook-based examples on docs: |
Thanks @shandou! On the issue:
Let’s bring this up in a separate GitHub issue, and continue the conversation there. |
@@ -0,0 +1,29 @@ | |||
import pytest |
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.
I’m so sorry, I should have made this clearer in the docs. This test should be in test_deconcatenate_column.py
, because all tests for a particular function go in a single .py
file. I don’t want to hold up this PR, so I’ll let itgo, and PR back the correct changes into dev
, so don’t worry about it 😄.
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.
Oops, sorry about that! (now I know what to do if similar situations are to happen in future). Thanks a lot!
Also, the entire CI process feels like magic~ I'll check if in the scipy talk you have talked about how this was set up, and how the stacks behind it was chosen.
Thanks for the PR, @shandou! |
@ericmjl Correction: Just checked again and the code cells actually allow horizontal scroll if I do a mouse click on them. So I think we are good (I think users who want to copy/paste code snippets would apply a mouse click) :) |
PR Description
This PR adds a boolean kwarg
preserve_position
to pyjanitor functiondeconcatenate_column
. The default is set toFalse
to avoid introducing breaking changes.When
preserve_position=True
df.columns
change from[... id ...]
into[... col1, col2, ...]
When
preserve_position=False
(default)df.columns
change from[... id ...]
into[... id ... col1, col2]
This PR resolves #478.
PR Checklist
Please ensure that you have done the following:
<your_username>
:master, but rather from<your_username>
:<branch_name>.AUTHORS.rst
.Quick Check
To do a very quick check that everything is correct, follow these steps below:
make check
from pyjanitor's top-level directory. This will automatically run:Once done, please check off the check-box above.
If
make check
does not work for you, you can execute the commands listed in the Makefile individually.Code Changes
If you are adding code changes, please ensure the following:
$ pytest .
) locally on your machine.Documentation Changes
If you are adding documentation changes, please ensure the following:
Relevant Reviewers
Please tag maintainers to review.