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

changes for filter panel constuctor #670

Merged
merged 8 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# teal 0.11.1.9000

* Updated internals of `module_teal` to reflect changes in `teal.slice` and `teal.data`.

# teal 0.11.1

### Enhancements
Expand Down
5 changes: 2 additions & 3 deletions R/module_teal.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ srv_teal <- function(id, modules, raw_data, filter = list()) {
env$progress$set(0.25, message = "Setting data")
# create the FilteredData object (here called 'datasets') whose class depends on the class of raw_data()
# this is placed in the module scope so that bookmarking can be used with FilteredData object
datasets <- teal.slice:::filtered_data_new(raw_data())
# transfer the datasets from raw_data() into the FilteredData object
teal.slice:::filtered_data_set(raw_data(), datasets)
datasets <- do.call(teal.slice::init_filtered_data, raw_data()$get_teal_inputs())
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not convinced that TealData should have method to return teal-ready list. I think the "converter" should be here in teal. TealData probably have all methods needed to extract data and attributes already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure turning teal_data/cdisc_data into a format we need for teal.slice will probably be quite involved (and we need to then have explicit if statement for if you are cdisc or not) for this

Copy link
Contributor

Choose a reason for hiding this comment

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

back then initialization of FilteredData was like this. We might have something similar in teal (as private method ofc). Not pushing though, let's see how TealData will be impacted in your proposition.

filtered_data_set.RelationalData <- function(data, datasets) { # nolintr # nousage

  datasets$set_code(data$get_code_class())

  for (dataset in data$get_datasets()) {
    dataname <- get_dataname(dataset)
    raw_dataset <- get_raw_data(dataset)
    datasets$set_data(dataname, raw_dataset)
    datasets$set_data_attrs(dataname, get_attrs(dataset))
    datasets$set_data_attr(dataname, "check", data$get_check_result())
  }

  datasets$set_join_keys(data$get_join_keys())

  return(invisible(NULL))
}


logger::log_trace("srv_teal@4 Raw Data transferred to FilteredData.")
datasets
})
Expand Down