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

[DEPR] Deprecate functions #1212

Merged
merged 23 commits into from
Jan 14, 2023
Merged

[DEPR] Deprecate functions #1212

merged 23 commits into from
Jan 14, 2023

Conversation

samukweku
Copy link
Collaborator

@samukweku samukweku commented Nov 27, 2022

Please describe the changes proposed in the pull request:

Add deprecation warnings for :

  • process_text,
  • rename_column,
  • rename_columns,
  • filter_on,
  • remove_columns,
  • fill_direction
  • add_column
  • add_columns
  • toset
  • find_replace
  • join_apply
  • change_type
  • fill_empty
  • groupby_agg

This PR is related to #1045 .

Please tag maintainers to review.

@ericmjl
Copy link
Member

ericmjl commented Nov 27, 2022

@codecov
Copy link

codecov bot commented Nov 27, 2022

Codecov Report

Merging #1212 (0852f09) into dev (8d298c7) will increase coverage by 0.02%.
The diff coverage is 97.91%.

@@            Coverage Diff             @@
##              dev    #1212      +/-   ##
==========================================
+ Coverage   97.67%   97.69%   +0.02%     
==========================================
  Files          78       78              
  Lines        3693     3730      +37     
==========================================
+ Hits         3607     3644      +37     
  Misses         86       86              

Copy link
Member

@ericmjl ericmjl left a comment

Choose a reason for hiding this comment

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

Wow, extensive work, @samukweku! Thank you for handling the deprecations!

from multipledispatch import dispatch


message = "This function will be deprecated in a 1.x release. "
message += "Kindly use `pd.DataFrame.assign` "
message += "or `jn.transform_column` instead."
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, in trying to write an example for how to write fill_direction using df.assign or df.transform_column, I wasn't able to easily replicate the functionality that you had here. Are we sure we want to deprecate fill_direction?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fill_direction can be replicated with assign:

In [175]: >>> df = pd.DataFrame(
...:             {
...:                 'col1': [1, 2, 3, 4],
...:                 'col2': [None, 5, 6, 7],
...:                 'col3': [8, 9, 10, None],
...:                 'col4': [None, None, 11, None],
...:                 'col5': [None, 12, 13, None]
...:             }
...:          )
...: df
Out[175]:
   col1  col2  col3  col4  col5
0     1   NaN   8.0   NaN   NaN
1     2   5.0   9.0   NaN  12.0
2     3   6.0  10.0  11.0  13.0
3     4   7.0   NaN   NaN   NaN

In [176]: df.assign(
               col2 = df.col2.bfill(), 
               col3 = df.col3.ffill(), 
               col4 = df.col4.ffill().bfill(), 
               col5 = df.col5.bfill().ffill())
Out[176]:
   col1  col2  col3  col4  col5
0     1   5.0   8.0  11.0  12.0
1     2   5.0   9.0  11.0  12.0
2     3   6.0  10.0  11.0  13.0
3     4   7.0  10.0  11.0  13.0

@samukweku samukweku self-assigned this Dec 6, 2022
@ericmjl
Copy link
Member

ericmjl commented Jan 14, 2023

Okie dokes, this PR has been open long enough. Let's merge, @samukweku?

@samukweku
Copy link
Collaborator Author

@ericmjl yes pls

@ericmjl ericmjl merged commit b451cc5 into dev Jan 14, 2023
@ericmjl ericmjl deleted the samukweku/deprecate branch January 14, 2023 20:16
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.

3 participants