-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
[Bug]: functions in data
raise warnings
#1352
Comments
Update: The second warning occurs in |
With the improvements that we've done here, we could prevent the function object to be returned from the environment by prefixing the object's name with a dot ( Once I changed The function object will still be in Show R Code for reproducibility. |
I hadn't noticed the change to the rules. I can't say I like it but I'll accept it. However, if one leaves a function in on purpose, one will get the warnings so the problem remains. |
Fair point and I agree. |
Acceptance criteria:
|
# Pull Request Fixes insightsengineering/teal#1366 Related: - insightsengineering/teal#1382 - #622 - insightsengineering/teal.data#340 ### Changes description - Removed assertion on datanames that start with alphabetic character - [x] Fix problem with JS namespace in filter panel - [x] Fix crash when filtering using MAE (both SE and Matrix) - [x ] ~Fix upload of snapshot file that is not compatible~ - [x] Ignore datanames that contain functions, language, expression (and other non-data objects) - insightsengineering/teal#1352 --------- Signed-off-by: André Veríssimo <[email protected]> Co-authored-by: Dawid Kałędkowski <[email protected]>
Closes #1352 This PR enables including any data type in the `data` (`teal_data`) object. - unfilterable datasets (not data.frame nor MAE) are not included in the filter-panel, but they are preserved in the `data` - unsupported data types are displayed in the data-summary-table but they are hidden by default - if any unsupported dataset is in the data they data-summary displays "show/hide unsupported" to toggle rows containing unsupported - functions are excluded from a hash calculation and this code is not included in SRC <table> <thead> <th>hide unsupported</th> <th>show unsupported</th> </thead> <tbody> <tr> <td> <img width="362" alt="image" src="https://github.com/user-attachments/assets/46839bad-b193-4b24-a549-d9f99b0e6064"> </td> <td> <img width="370" alt="image" src="https://github.com/user-attachments/assets/270a077b-4175-4967-b6e4-026c8f9ac28c"> </td> </tr> </tbody> <table> <details> <summary>App example</summary> ```r devtools::load_all("teal.slice") devtools::load_all("teal") options("teal.bs_theme" = bslib::bs_theme(version = "5")) data <- teal_data() |> within({ library(MultiAssayExperiment) data(miniACC, envir = environment()) iris <- iris foo <- function(x) cat("hello\n") vector <- letters }) modules <- modules( example_module( transformers = teal_transform_module(server = function(id, data) { moduleServer(id, function(input, output, session) { reactive({ data() |> within({ foo2 <- function() NULL }) }) }) }) ), example_module(datanames = "iris") ) app <- init(data = data, modules = modules) runApp(app) ``` </details> --------- Signed-off-by: Vedha Viyash <[email protected]> Co-authored-by: Marcin <[email protected]> Co-authored-by: vedhav <[email protected]> Co-authored-by: Vedha Viyash <[email protected]>
What happened?
When
data
contains a function, a warning is logged when runninginit
:A similar one is logged when the app is run:
It looks like it's happening in
create_app_id
. I modified the function so thatdata
is also passed throughdefunction
and that removed the warning raised when runninginit
but not the one raised when runninng the app.example app
sessionInfo()
No response
Relevant log output
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: