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.
mih
left a comment
There was a problem hiding this comment.
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? |
This PR changes the behaviour of
createandrun_procedureso that using an incorrect (unavailable) procedure name results in an error. Closes #6129Specifically, the following changes were made:
run_procedureon its own was changed to raise aValueErrorinstead of reporting a result withstatus='impossible'run_procedure(discover=True)was introduced indatalad createbefore any creation takes place to check whether the requestedcfg_proc(s)are available.run_procedure(spec, ...)whenspecis 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:
createasserting thatValueErroris raised and the dataset is not createdrun_procedureasserting that it can be done with a (proper) dictionary input.