Skip to content

No error for data_color() + empty tidyselect for consistency with fmt_*() #1795

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 4 commits into from
Jul 16, 2024

Conversation

olivroy
Copy link
Collaborator

@olivroy olivroy commented Jul 16, 2024

Summary

After thinking about this a bit more, you are right that if we supply a tidyselect expression to rows or columns that resolves to nothing, we should just leave the data unchanged.

This PR takes care of this and adds test to verify consistency between data_color() and fmt_number().

Related GitHub Issues and PRs

fixes #1665 and amends #1660

Checklist

@olivroy olivroy changed the title Data color resolve No error for data_color() + tidyselect for consistency Jul 16, 2024
@olivroy olivroy changed the title No error for data_color() + tidyselect for consistency No error for data_color() + empty tidyselect for consistency with fmt_*() Jul 16, 2024
Copy link
Member

@rich-iannone rich-iannone left a comment

Choose a reason for hiding this comment

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

LGTM!

@rich-iannone rich-iannone merged commit a96a1a0 into rstudio:master Jul 16, 2024
13 checks passed
@olivroy olivroy deleted the data-color-resolve branch August 26, 2024 13:33
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.

data_color() should return data unchanged if a tidyselect expressions resolved to 0
2 participants