Skip to content

CLN: Use exclusions in determination of _selected_obj #50416

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 1 commit into from
Dec 27, 2022

Conversation

rhshadrach
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Toward #46944.

Currently we use whether a grouping is in-axis or not to determine if it should make it into _selected_obj. This is almost the same as using exclusions, except for a TimeGrouper. Here, the grouping data may arise from a column and hence should be excluded, however the grouping data is not the column itself but rather derived from the column, so it is not technically in-axis. Such columns should not make it into _selected_obj, so we should prefer using excluded directly rather than in-axis.

This does not change the behavior of Resampler because Resampler is a subclass of BaseGroupBy which does not have the selection context.

@rhshadrach rhshadrach added this to the 2.0 milestone Dec 23, 2022
@jbrockmendel
Copy link
Member

Possibly related #46944

@rhshadrach
Copy link
Member Author

Right - some of the next steps include moving the group selection context to BaseGroupBy and using _selected_obj within the context in Resampler instead of _obj_with_exclusions

@mroeschke mroeschke merged commit e16a945 into pandas-dev:main Dec 27, 2022
@mroeschke
Copy link
Member

Thanks @rhshadrach

@rhshadrach rhshadrach deleted the exclusions_in_selected_obj branch December 27, 2022 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants