-
Notifications
You must be signed in to change notification settings - Fork 110
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
BF produce an error in create and run_procedure if procedure does not exist #6143
Conversation
Previously the operation reported a result with status: impossible. This commit also changes an applicable test to use assert_raises().
If the specified cfg_proc cannot be discovered, throw an error before creating the dataset.
This commit allows run_procedure to accept as input a dictionary reported by run_procedure(discover=True), causing it to skip calling _get_procedure_implementation(). This mechanism is used in create: first run_procedure(discover=True) is executed to establish availability before creating the dataset, and then the results are used to run the procedure on the created dataset.
Codecov Report
@@ Coverage Diff @@
## master #6143 +/- ##
===========================================
- Coverage 89.73% 36.13% -53.60%
===========================================
Files 317 318 +1
Lines 42394 41871 -523
===========================================
- Hits 38042 15131 -22911
- Misses 4352 26740 +22388
Continue to review full report at Codecov.
|
In create, test whether running with an incorrect cfg_proc produces a ValueError and no dataset is created. In cfg_proc, test whether a dictionary returned by run_procedure(discover=True) will be accepted as the spec argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the PR!
Apart from a performance-related aspect, the approach looks good and clean to me. Once the multi-call- issue is fixed, we can merge this IMHO. Thx!
Co-authored-by: Michael Hanke <michael.hanke@gmail.com>
Call run_procedure(discover=True) once, creating a list which is then checked, instead of calling it with return_type='generator' for each specified cfg_proc.
The failure on travis seems unrelated:
You can fix the I tried your change, works nicely for me - thanks! |
Thank you for taking a look at the proposed changes and the checks @adswa!
Guess so, unless that's a weird collateral - unfortunately, I have nothing to add (edit: this test passes on my laptop).
Thanks for pointing it out (we also talked about it with @bpoldrack yesterday). Indeed, I do not have permissions - no button saying "Add label" where it would normally be. Whether that's something to be fixed, I don't know. I think that's tied to repository write access? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the update, LGTM now.
This PR changes the behaviour of
create
andrun_procedure
so that using an incorrect (unavailable) procedure name results in an error. Closes #6129Specifically, the following changes were made:
run_procedure
on its own was changed to raise aValueError
instead of reporting a result withstatus='impossible'
run_procedure(discover=True)
was introduced indatalad create
before any creation takes place to check whether the requestedcfg_proc(s)
are available.run_procedure(spec, ...)
whenspec
is a dictionary.The third change seems the most "invasive" to me so I'd be happy to have your opinions on whether this is the correct way.
Resulting behaviour:
Remaining TODO items:
create
asserting thatValueError
is raised and the dataset is not createdrun_procedure
asserting that it can be done with a (proper) dictionary input.