-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Prototype ddl + tdata #140
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ta_in_tealdata@main
adsl <- synthetic_cdisc_data("latest")$adsl adtte <- synthetic_cdisc_data("latest")$adtte jk <- default_cdisc_join_keys(c("adsl", "adtte")) tdata_obj <- new_tdata2( data = list(adsl = adsl, adtte = adtte), code = ' adsl <- synthetic_cdisc_data("latest")$adsl adtte <- synthetic_cdisc_data("latest")$adtte ', jk ) tdata_obj2 <- eval_code(tdata_obj, quote(new <- data.frame(a = 1))) tdata_obj2[["new"]] tdata_obj2[["adsl"]] get_code(tdata_obj2)
gogonzo
commented
Jul 5, 2023
Comment on lines
+4
to
+13
#' @export | ||
setClass( | ||
Class = "tdata", | ||
contains = "qenv", | ||
slots = c(join_keys = "JoinKeys", datanames = "character"), | ||
prototype = list( | ||
join_keys = join_keys(), | ||
datanames = character(0) | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruckip imagine non-ddl cdisc_data
could be just an extension of qenv
. This class transports data, code and join_keys
down to the modules.
Closing in favour of #161 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch presents prototype of the new
tdata
object being a replacement to theTealData
and friends. Look at the removed and added number of lines to see why ;)This branch two independent issues are addressed.
1. The DDL
New DDL object structure is a simple object containing:
"adsl <- adsl <- synthetic_cdisc_data({ arg })$adsl"
{ arg }
in the RETURNED code.{ arg }
element. In this case it suppose to be atextInput(id = "latest")
. These inputs replace relevant{ arg }
in the EVALUATED code.input
postprocess_fun
tdata
object which is then passed further to teal.It might seem that responsibilities of the server are diffficult, they are not. If you look at the
username_password_server
the code has only one simple eventReactive call, thanks to theddl_run
which wraps everything together and return what has been specified in thepostprocess_fun
.ddl_run
automatically matchescode
,input
andoffline_args
and executespostprocess_fun
.custom example
Try simple example below.
code
and relevantui
are specified to evaluate the code.postprocess_fun
returns simple list withdata
andcode
(normally we would returntdata
). Example app utilizingddl
object just callsui
andserver
and displaysserver
output (as ddl resolves code independently).2. Standardize data flow in teal
In this prototype
tdata
is an S4 class inheriting fromqenv
.tdata
has extrajoin_keys
anddatanames
slots. Object is mutable - one can useeval_code
function and it's reproducible asqenv
. This object can be included in theteal_module
modules and it could replace aqenv
object.tdata manipulation
example custom ddl connection
example scda connector