BristolMyersSquibb / blockr

Composable, extensible no-code UI
https://bristolmyerssquibb.github.io/blockr/
GNU General Public License v3.0
32 stars 3 forks source link

Dataset switch in join block does not update `by` #273

Open nbenn opened 7 months ago

nbenn commented 7 months ago

If I start the app with 2 compatible datasets, I add a third stack with a data_block, not compatible with the second stack data set, select this new stack as my new y value, the by choice doesn't reflect the situation and keeps the old values in memory. The result is shown in the below image where I am trying to join adverse events data with the airquality data (which doesn't make sense of course).

library(blockr)
library(blockr.data)

lab_data_block <- function(...) {
  initialize_block(new_data_block(
    ...,
    dat = as.environment("package:blockr.data"),
    selected = "lab"
  ))
}

ae_data_block <- function(...) {
  initialize_block(new_data_block(
    ...,
    dat = as.environment("package:blockr.data"),
    selected = "ae"
  ))
}

serve_workspace(
  stack1 = new_stack(lab_data_block, head_block),
  stack2 = new_stack(ae_data_block, join_block),
  title = "My workspace"
)
Screenshot 2024-02-07 at 12 08 35

Originally posted by @DivadNojnarg in https://github.com/blockr-org/blockr/issues/264#issuecomment-1931816336

DivadNojnarg commented 7 months ago

@nbenn #272 does not seem to auto fix this one.

nbenn commented 7 months ago

I saw, yes. I might have a solution though.

JohnCoene commented 3 weeks ago

I think this can be closed.