Skip to content

[Question]: Does choices_selected check if selected is in choices for value_choices? #253

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

Closed
3 tasks done
llrs-roche opened this issue Feb 10, 2025 · 2 comments
Closed
3 tasks done
Assignees

Comments

@llrs-roche
Copy link

What is your question?

This issue related to one on tmc which aims to provide better error messages: insightsengineering/teal.modules.clinical#1317. A simple example is:

choices_selected(
  value_choices("ADTTE", "PARAMCD", "PARAM"),
  "OS"
)

Where the selected value is not on the choices and it doesn't return an error or even a warning. Should it return one? I think it does and as such it would be a bug on teal.transform.

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@llrs-roche llrs-roche added core question Further information is requested labels Feb 10, 2025
@shajoezhu
Copy link
Contributor

i think it should throw an error, as a validation step

@llrs-roche llrs-roche added bug and removed question Further information is requested labels Feb 11, 2025
@llrs-roche
Copy link
Author

Closing as the redesign feature on #256 will error on this case. The equivalent (at this moment) when trying to resolve this would be:

resolver(c(datasets("ADTTE"), variables("PARAMCD", "OS")), 
     within(teal.data::teal_data(), {
        ADTTE <- data.frame(PARAMCD = 1, OS = 1)})
      )
)
Error: No variables selection is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants