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

Fix FeatureEffect handling of empty levels #160

Merged
merged 1 commit into from
Jan 23, 2021

Conversation

grantirv
Copy link

Motivation

FeatureEffect does not handle empty levels correctly. The existing test missed this bug because it was only testing the special case where the last level is empty.

Implementation

Fixed by adding the missing droplevels(x). It may be cleaner to add a line x <- droplevels(x) immediately after x is created, and then remove all the droplevels(x) statements elsewhere.

The test was updated to catch the bug by simply reversing the order of the levels.

The existing test missed this bug because it was only testing the special case where the last level is empty.
@christophM
Copy link
Collaborator

Thanks for finding and fixing this non-obvious issue! Good find.

@christophM christophM merged commit f1edf3b into giuseppec:master Jan 23, 2021
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