Closed volcan01010 closed 2 years ago
I've added WIP until I have updated the README.
README updated.
@ximenesuk - I've tagged you as reviewer for this but I know that you are on leave. There is no rush to do this before the new year, so unless you get coding withdrawal symptoms then it can wait until you are back. I only did it now because the ideas were fresh in my head and I had some non-sprint days.
I just added the demonstration script above to the README documentation as the data loading function. It will be useful to have it their as a demo that people can play with.
Tests all passed. I tried the script as-is, with a different on_error
and with the default argument. It all worked fine.
Description
This merge request add the
on_error
parameter toexecutemany
. If a chunk raises an error then it will be retried as individual rows and the failing rows and their exceptions collected into a list. Theon_error
function is then called on the list.This provides a flexible way for users to handle failing rows in "real" time, as any function can be used. The updated README.md has details.
Closes #91, which has much more discussion (and also #113, which is a bug-fix)
The changes also include making
chunk_size
a named parameter on many of the functions. This makes it more convenient to change, rather than having to modify a module-level constant.To test
To experiment, use the script below to test out inserting data to a SQLite database. Try writing your own
on_error
functions.