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

Fix the datanames bug causing teal app to crash when teal_data has non standard object names #1367

Closed
wants to merge 5 commits into from

Conversation

vedhav
Copy link
Contributor

@vedhav vedhav commented Oct 8, 2024

Closes #1366

@vedhav vedhav added bug Something isn't working core labels Oct 8, 2024
@vedhav vedhav marked this pull request as ready for review October 8, 2024 13:07
@gogonzo gogonzo self-assigned this Oct 8, 2024
@@ -359,7 +359,9 @@ srv_teal_module.teal_module <- function(id,

.resolve_module_datanames <- function(data, modules) {
stopifnot("data_rv must be teal_data object." = inherits(data, "teal_data"))
if (is.null(modules$datanames) || identical(modules$datanames, "all")) {
if (length(datanames(data))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this can be a first condition. If datanames are not null then other conditions will be ignored.

R/utils.R Outdated
@@ -74,10 +74,13 @@ get_teal_bs_theme <- function() {
#' @param datanames (`character`) vector of data set names to include; must be subset of `datanames(x)`
#' @return A `FilteredData` object.
#' @keywords internal
teal_data_to_filtered_data <- function(x, datanames = ls(teal.code::get_env(x))) {
teal_data_to_filtered_data <- function(x, datanames = teal.data::datanames(data)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can instead relax the assertion on datanames in teal.slice?

Copy link
Contributor

@gogonzo gogonzo left a comment

Choose a reason for hiding this comment

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

PR brings back datanames() <- setter which is going to be deprecated soon. This PR fixes issue by introducing other (postponed)

Copy link
Contributor

github-actions bot commented Oct 8, 2024

Unit Tests Summary

  1 files   25 suites   16m 33s ⏱️
254 tests 237 ✅ 4 💤 13 ❌
509 runs  491 ✅ 4 💤 14 ❌

For more details on these failures, see this check.

Results for commit 0144176.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Oct 8, 2024

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
module_teal 💔 $63.99$ $+481.00$ $0$ $0$ $+13$ $0$
shinytest2-landing_popup 💚 $45.45$ $-1.49$ $0$ $0$ $0$ $0$
shinytest2-modules 💚 $39.23$ $-1.10$ $0$ $0$ $+1$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
module_teal 💔 $19.25$ $+482.28$ creation_process_is_invoked_for_teal.lockfile.mode_enabled_and_snapshot_is_copied_to_teal_app.lock_and_removed_after_session_ended
utils 👶 $+0.01$ teal_data_to_filtered_data_creates_FilterData_class_with_datanames_that_are_passed

Results for commit d1b8670

♻️ This comment has been updated with latest results.

@vedhav vedhav force-pushed the 1366-pass-proper-datanames@main branch from e8e6a11 to 0144176 Compare October 8, 2024 13:37
@gogonzo gogonzo closed this Oct 15, 2024
@gogonzo gogonzo deleted the 1366-pass-proper-datanames@main branch October 15, 2024 06:13
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Teal app crashes when the input teal_data has objects that fail check_simple_name()
2 participants