ucam-department-of-psychiatry / crate

Create and use de-identified research databases. Preprocess, extract text, anonymise/de-identify, link, apply natural language processing, query for research, manage consent for contact.
GNU General Public License v3.0
19 stars 8 forks source link

Handle failure to insert row in destination table during NLP #41

Closed martinburchell closed 3 years ago

martinburchell commented 3 years ago

Fixes https://github.com/RudolfCardinal/crate/issues/40

We can't guarantee that the NLP output will be valid for the destination table so handle errors when inserting rows.

This was already being handled for cloud NLP but I've made the error handling consistent so we catch all instances of DatabaseError (OperationalError, DataError etc).