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

Add workspace stack #428

Open
JohnCoene opened this issue Oct 6, 2024 · 3 comments
Open

Add workspace stack #428

JohnCoene opened this issue Oct 6, 2024 · 3 comments
Labels
question Further information is requested

Comments

@JohnCoene
Copy link
Member

I don't understand this line

if (!isTRUE(force) && name %in% list_workspace_stacks(workspace)) {

If force is not TRUE and that the stack is already found in the workspace we emit a warning. Shouldn't it instead not overwrite the stack in the workspace if the stack is already found in the workspace rather than just emit a warning?

@JohnCoene JohnCoene added the question Further information is requested label Oct 6, 2024
@JohnCoene
Copy link
Member Author

Also, I don't understand the difference with set_workspace_stack

set_workspace_stack <- function(name, stack, force = FALSE,

@nbenn
Copy link
Collaborator

nbenn commented Oct 7, 2024

@JohnCoene happy to be more strict here and promote the warning(s) to error(s). As to "what is the difference": "add" is meant to add a new stack, while "set" was thought for updating an existing stack. Happy to rename set_workspace_stack() to make this clearer.

@JohnCoene
Copy link
Member Author

@nbenn Thank you.

My question is because 1) both functions are identical as far as I can tell so add == set and 2) if force = FALSE then the function still performs the action, only with a warning.

It may be me but I would expect set_workspace_stack to not create a new stack in the workspace if it is not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants