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(python): Deprecate some parameters of cut/qcut #10484

Merged
merged 8 commits into from
Aug 15, 2023
Merged

depr(python): Deprecate some parameters of cut/qcut #10484

merged 8 commits into from
Aug 15, 2023

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Aug 14, 2023

Partially addresses #10468

Changes

  • Rename series parameter to as_series and deprecate it. This is a remnant of the old pl.cut function. The method should just return a Series - possibly a struct Series if include_breaks=True.
  • Add overload typing specification (will be removed when as_series is removed).
  • Deprecate category_label and break_point_label. This is unnecessary parameter bloat. We should set sensible naming defaults and allow the user to overwrite it with Series.struct.rename_fields if they want.
  • Clean up docstrings, doc exampes, tests.

To do, in a different PR:

  • Split the parameter quantiles for qcut into two parameters - probabilities and n_bins (not 100% sure about the names).

@github-actions github-actions bot added deprecation Add a deprecation warning to outdated functionality python Related to Python Polars labels Aug 14, 2023
@stinodego stinodego force-pushed the cut-qcut branch 3 times, most recently from bf0409d to 8c216c0 Compare August 14, 2023 18:38
@stinodego stinodego marked this pull request as ready for review August 14, 2023 18:43
@magarick
Copy link
Contributor

Would this be a breaking change since some people seemed to be depending on the old behavior. I don't know why but that's why I kept it as an option.

@stinodego
Copy link
Member Author

stinodego commented Aug 15, 2023

Would this be a breaking change

This is just a deprecation. It would normally to be followed by a breaking change to actually remove the deprecated behavior.

@stinodego stinodego merged commit ea84dc4 into main Aug 15, 2023
12 checks passed
@stinodego stinodego deleted the cut-qcut branch August 15, 2023 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation Add a deprecation warning to outdated functionality python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants