Skip to content

Performance improvements + test refactoring + standardize error message from resolver #1753

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 10 commits into from
Jul 5, 2024

Conversation

olivroy
Copy link
Collaborator

@olivroy olivroy commented Jul 5, 2024

Summary

  • Speed improvement.
  • Test reorg
  • Error message consistency

I calculated a 30-50% speed increase for summary_rows() generation. (Lost my reprex during the day)

Important note, took me a while to debug, but if using vctrs::vec_slice() instead of dplyr::filter(), if NA are possible, we have to check for !is.na() first, just like base subsetting.

.by doesn't reorder rows, but didn't seem to cause any issue!

Major refactoring of some test files.

Basically using

expect_match_html(
  gt_tbl,
  c("pattern1")
)

as a shortcut to

expect_match(
  render_as_html(gt_tbl),
  c("pattern1")
)

I added a way to iterate on pattern to test for multiple patterns.

I also separated tests and reordered them with my newly created RStudio snippet.

snippet newtest
	})
	
	test_that("${1:name}", {
		${0}

Checklist

@olivroy olivroy changed the title Another round of cleanup Performance improvements + test refactoring Jul 5, 2024
@olivroy olivroy requested a review from rich-iannone July 5, 2024 21:20
@olivroy olivroy changed the title Performance improvements + test refactoring Performance improvements + test refactoring + standardize error message from resolver Jul 5, 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
Copy link
Member

Thank you, these are all great improvements!

@rich-iannone rich-iannone merged commit 033af8f into rstudio:master Jul 5, 2024
12 checks passed
@olivroy olivroy deleted the error-msg-final branch July 5, 2024 22:57
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