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

Clarify that submission_tmpl() can take either a hub connection OR a config file #137

Open
zkamvar opened this issue Oct 25, 2024 · 0 comments

Comments

@zkamvar
Copy link
Member

zkamvar commented Oct 25, 2024

I was recently exploring the submission_tmpl() function and it looks like it's really useful! When I tried to run it the first time, I assumed that both hub_con, config_tasks, and round_id were all required (since they didn't have defaults), but I got this error:

Error in `hubValidations::submission_tmpl()`:
! Exactly one of `hub_con` or `config_tasks` must be supplied.
Run `rlang::last_trace()` to see where the error occurred.

Simple fix

Clearly state in the documentation that hub_con and config_tasks are mutually exclusive (e.g. in the arguments themselves).

This fix won't prevent people from doing what I did, but at least there will be a sign that instructs them about the right way to do it.

Robust fix

Make submission_tmpl() an S3 method for hub_connection and config classes and remove the config_tasks argument.

I consider this a more robust fix because the function really only needs the config be it accessed through a hub or the config object directly. We could even add a method for character objects to read from a file (it should probably be a path to a hub).

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

No branches or pull requests

1 participant