airr-standards icon indicating copy to clipboard operation
airr-standards copied to clipboard

airr-tools validate airr stops after reporting first error

Open schristley opened this issue 3 years ago • 5 comments

@javh Is it easy to do this and report all errors? It's very tedious having to fix one error at a time, I have to edit and run a conversion script each time, so would like to do bulk changes.

schristley avatar Aug 18 '22 06:08 schristley

Should be. I'll look at it tomorrow. If it worked differently before, then I made a mistake during the refactor.

javh avatar Aug 18 '22 07:08 javh

Okay, so here's what's going on with this.

It's not an interface change, it's how Schema.validate_object() works (which I didn't touch). It raises ValidationError upon the first failure. We would have to redesign validate_object() to store all the property errors and then do a single raise with the full list of messages at the end. It looks fixable (I say having not tried yet) with some (not huge) effort.

I'm not opposed to fixing this for v1.4, but because it does look like it's working as intended, my preference is to push this back to a v1.4.1 or something. I could really go either way though.

There's a separate problem with the logic in airr-tools validate in that it exits if there's a validation error in the first file and doesn't check subsequent files. That's an obvious bug and easy to fix. I'll put in a PR for that.

javh avatar Aug 18 '22 17:08 javh

Ok, I see. I was thinking we had it before. It must be the multiple files I was think of. Yeah, modifying validate_object is tricky with the recursion.

schristley avatar Aug 18 '22 18:08 schristley

I can see how both behaviors are useful. In a batch processing mode, you might want it to stop immediately if invalid, and not waste time validating the rest. So if we add, we should probably have a flag to pick.

schristley avatar Aug 19 '22 06:08 schristley

True. Let's come back to this after v1.4 then.

javh avatar Aug 19 '22 16:08 javh

Closing as stale

javh avatar Sep 09 '24 03:09 javh