Prototype ddl + tdata - #140
Closed
gogonzo wants to merge 19 commits into
Closed
Conversation
…ta_in_tealdata@main
prototype
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)
some fixes
up
tdata to inherit from qenv
remove unnecessary
remove tests
yup
more docs
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) | ||
| ) | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
@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.
Contributor
Author
|
Closing in favour of #161 |
This file contains hidden or 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
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
tdataobject being a replacement to theTealDataand 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.inputpostprocess_funtdataobject 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_serverthe code has only one simple eventReactive call, thanks to theddl_runwhich wraps everything together and return what has been specified in thepostprocess_fun.ddl_runautomatically matchescode,inputandoffline_argsand executespostprocess_fun.custom example
Try simple example below.
codeand relevantuiare specified to evaluate the code.postprocess_funreturns simple list withdataandcode(normally we would returntdata). Example app utilizingddlobject just callsuiandserverand displaysserveroutput (as ddl resolves code independently).2. Standardize data flow in teal
In this prototype
tdatais an S4 class inheriting fromqenv.tdatahas extrajoin_keysanddatanamesslots. Object is mutable - one can useeval_codefunction and it's reproducible asqenv. This object can be included in theteal_modulemodules and it could replace aqenvobject.tdata manipulation
example custom ddl connection
example scda connector