Skip to content

[ENH] fix bug pivot_longer #828

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 18 commits into from
Apr 12, 2021
Merged

[ENH] fix bug pivot_longer #828

merged 18 commits into from
Apr 12, 2021

Conversation

samukweku
Copy link
Collaborator

@samukweku samukweku commented Apr 8, 2021

PR Description

Please describe the changes proposed in the pull request:

  • fix bug where sub structures are series, not dataframes, preventing melt from occuring.

This PR resolves #827.

PR Checklist

Please ensure that you have done the following:

  1. PR in from a fork off your branch. Do not PR from <your_username>:dev, but rather from <your_username>:<feature-branch_name>.
  1. If you're not on the contributors list, add yourself to AUTHORS.rst.
  1. Add a line to CHANGELOG.md under the latest version header (i.e. the one that is "on deck") describing the contribution.
    • Do use some discretion here; if there are multiple PRs that are related, keep them in a single line.

Automatic checks

There will be automatic checks run on the PR. These include:

  • Building a preview of the docs on Netlify
  • Automatically linting the code
  • Making sure the code is documented
  • Making sure that all tests are passed
  • Making sure that code coverage doesn't go down.

Relevant Reviewers

Please tag maintainers to review.

@samukweku samukweku self-assigned this Apr 8, 2021
@samukweku
Copy link
Collaborator Author

the test error is from janitors/finance.py. It seems the url is not working anymore, and one may have to register on the site to get api keys. Not sure what the alternative is;

@ericmjl
Copy link
Member

ericmjl commented Apr 8, 2021

@samukweku I triggered a test re-run. Let's see what happens.

@ericmjl
Copy link
Member

ericmjl commented Apr 8, 2021

@samukweku looks like the tests are still failing.

Good digging before on this - if indeed we need an API key to do currency conversions, then it's going to be challenging for users and for us. We might need to either:

  1. Find a different service, or
  2. Deprecate the finance APIs.

For now, I don't want this to be a blocker for you. Could you mark the tests as xfail and let's get the bug fix in first? Also, can you add in a comment that references my response, so we have context on why it's marked xfail?

@samukweku
Copy link
Collaborator Author

@ericmjl, there is a notebook for currency conversion that also fails, since it is based on the API?

@ericmjl
Copy link
Member

ericmjl commented Apr 9, 2021

Looks like that one will also have to be taken offline. Can you disable them in the sphinx configuration file? There should be a conf.py. I found the docs; the info in there should give you a headstart!

@codecov-io
Copy link

codecov-io commented Apr 10, 2021

Codecov Report

Merging #828 (a5bef34) into dev (d743e3a) will decrease coverage by 0.30%.
The diff coverage is 98.36%.

@@            Coverage Diff             @@
##              dev     #828      +/-   ##
==========================================
- Coverage   95.62%   95.32%   -0.31%     
==========================================
  Files          19       19              
  Lines        1989     1966      -23     
==========================================
- Hits         1902     1874      -28     
- Misses         87       92       +5     

@samukweku
Copy link
Collaborator Author

@ericmjl I think I'm missing something regarding the conf.py/individual notebook execution stop; if you have an idea i'll gladly take that and resolve this. explicitly disable jupyter notebook execution

@ericmjl
Copy link
Member

ericmjl commented Apr 10, 2021

@samukweku I just pushed a small change to conf.py. Let's see if that fixes the problem.

@ericmjl
Copy link
Member

ericmjl commented Apr 10, 2021

@samukweku I went back and forth on what would be the best way to resolve this issue. The best way is to look for a new exchange rates API, while disabling the function so that we can retain the state of "all tests passing". We can invite users to help us find a new API that we can hit.

@ericmjl
Copy link
Member

ericmjl commented Apr 10, 2021

@anzelpwj and @zjpoh, sorry to bother you two here, but I'm struggling to figure out why the spark session thingy is failing. Would either of you be kind enough to help out here?

@jk3587
Copy link
Collaborator

jk3587 commented Apr 12, 2021

nit: I suggest we change the error to say we "call" the api instead of "hit" (or anything other than "hit").

@ericmjl
Copy link
Member

ericmjl commented Apr 12, 2021

@jk3587 good call on that one (*cough cough*) 😃. I will change that.

@ericmjl
Copy link
Member

ericmjl commented Apr 12, 2021

Oh my, we're finally done here!

@ericmjl
Copy link
Member

ericmjl commented Apr 12, 2021

@samukweku going to merge now.

@ericmjl ericmjl merged commit 796756e into dev Apr 12, 2021
@thatlittleboy thatlittleboy deleted the pivot_longer_single_level_fix branch February 5, 2022 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] pivot_longer fails when number of entries differ for '.value'
4 participants