Skip to content

Commit

Permalink
Simplify styler_df() signature (#1009)
Browse files Browse the repository at this point in the history
* Get rid of unnecessary `.name_repair` arg

This is generating warnings.

Follow-up on #1007

* make the wrapper even thinner
  • Loading branch information
IndrajeetPatil authored Sep 28, 2022
1 parent 1a8bab3 commit 35519b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions R/parse.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ get_parse_data <- function(text, include_text = TRUE, ...) {
# avoid https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16041
parse_safely(text, keep.source = TRUE)
parsed <- parse_safely(text, keep.source = TRUE)
pd <- styler_df(
utils::getParseData(parsed, includeText = include_text),
.name_repair = "minimal"
)
pd <- utils::getParseData(parsed, includeText = include_text) %>%
styler_df()
if (getRversion() < "4.2") {
is_unicode_parsing_error <- grepl("^\"<U\\+[0-9]+>\"$", pd$text)
if (any(is_unicode_parsing_error)) {
Expand Down Expand Up @@ -163,7 +161,7 @@ ensure_correct_txt <- function(pd, text) {
by.y = "id",
suffixes = c("", "parent")
) %>%
styler_df(.name_repair = "minimal")
styler_df()

if (!lines_and_cols_match(new_text)) {
abort(paste(
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ line_col_names <- function() {
#' Wrapper functions to encapsulate data frame creation
#' @keywords internal
#' @noRd
styler_df <- function(..., .size = NULL, .name_repair = "minimal") {
vctrs::data_frame(..., .size = .size, .name_repair = .name_repair)
styler_df <- function(...) {
vctrs::data_frame(..., .name_repair = "minimal")
}

#' @keywords internal
Expand Down

0 comments on commit 35519b9

Please sign in to comment.