Skip to content
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

[BUG] fillna downcast fix for complete function #1289

Merged
merged 9 commits into from
Oct 8, 2023

Conversation

samukweku
Copy link
Collaborator

@samukweku samukweku commented Sep 18, 2023

PR Description

Please describe the changes proposed in the pull request:

  • remove downcast=infer from fillna - pandas no longer supports that option
  • remove support for completing on the index - remove complexity
  • fix bug in groupby logic - inspired by a Stack Overflow question
  • callables in dictionary evaluates on the entire dataframe, not a Series

This PR improves the complete function.

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.md.
  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 Sep 18, 2023
@ericmjl
Copy link
Member

ericmjl commented Sep 18, 2023

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #1289 (662d5b4) into dev (3f4a034) will decrease coverage by 1.21%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev    #1289      +/-   ##
==========================================
- Coverage   97.36%   96.15%   -1.21%     
==========================================
  Files          78       78              
  Lines        4176     4114      -62     
==========================================
- Hits         4066     3956     -110     
- Misses        110      158      +48     

@ericmjl
Copy link
Member

ericmjl commented Sep 23, 2023

@samukweku this branch appears to have a conflict that I'm not confident in resolving. Would you be kind enough to help here please?

@ericmjl
Copy link
Member

ericmjl commented Oct 2, 2023

GitBot Summary of Changes

The pull request includes changes to the complete function in the janitor/functions/complete.py file and its corresponding tests in tests/functions/test_complete.py.

In complete.py, the logic for groupby in the complete function has been fixed. The support for index has been deprecated and the deprecation warning for fillna in complete has been fixed. The select function now supports variable arguments.

In test_complete.py, a new test case has been added to raise a ValueError if the passed label is not found. The test case for multiindex names not found has been updated.

In CHANGELOG.md, the changes have been documented under the [Unreleased] section.

The changes ensure that the complete function works as expected and improves its overall functionality.

cc: @samukweku, please check for correctness!

@ericmjl
Copy link
Member

ericmjl commented Oct 2, 2023

Thank you, @samukweku!

@samukweku samukweku changed the title [BUGFIX] fillna downcast fix for complete function [BUG] fillna downcast fix for complete function Oct 7, 2023
@ericmjl
Copy link
Member

ericmjl commented Oct 8, 2023

Let's merge, @samukweku! It's been long enough 😄.

@ericmjl ericmjl merged commit e096587 into dev Oct 8, 2023
5 of 6 checks passed
@samukweku samukweku deleted the samukweku/complete_fillna branch November 18, 2023 02:12
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.

2 participants