Skip to content

Commit

Permalink
fix: extend fix to other occurences of label
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Feb 19, 2024
1 parent 558e3b8 commit 5d9e0c5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

### Bug fixes

* Performs an exact match on `init_filtered_dataset` when determining the default label of a dataset.
* Performs an exact match when determining the default label of a dataset from attributes.

### Miscellaneous

Expand Down
2 changes: 1 addition & 1 deletion R/FilterState.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ FilterState <- R6::R6Class( # nolint
if (is.null(isolate(slice$keep_na)) && anyNA(x)) slice$keep_na <- TRUE
private$teal_slice <- slice
# Obtain variable label.
varlabel <- attr(x, "label")
varlabel <- attr(x, "label", exact = TRUE)
# Display only when different from varname.
private$varlabel <-
if (is.null(varlabel) || identical(varlabel, private$get_varname())) {
Expand Down
2 changes: 1 addition & 1 deletion R/FilterStateChoices.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ ChoicesFilterState <- R6::R6Class( # nolint
x_factor <- if (!is.factor(x)) {
structure(
factor(as.character(x), levels = as.character(sort(unique(x)))),
label = attr(x, "label")
label = attr(x, "label", exact = TRUE)
)
} else {
x
Expand Down
2 changes: 1 addition & 1 deletion R/FilteredDataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ FilteredDataset <- R6::R6Class( # nolint
#'
#' @return Object of class `FilteredDataset`, invisibly.
#'
initialize = function(dataset, dataname, keys = character(0), label = attr(dataset, "label")) {
initialize = function(dataset, dataname, keys = character(0), label = attr(dataset, "label", exact = TRUE)) {
logger::log_trace("Instantiating { class(self)[1] }, dataname: { dataname }")

# dataset assertion in child classes
Expand Down
2 changes: 1 addition & 1 deletion man/FilteredDataset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5d9e0c5

Please sign in to comment.