BritishGeologicalSurvey / etlhelper

ETL Helper is a Python ETL library to simplify data transfer into and out of databases.
https://britishgeologicalsurvey.github.io/etlhelper/
GNU Lesser General Public License v3.0
105 stars 25 forks source link

Bug: `load` function crashes when passed empty input #120

Closed volcan01010 closed 2 years ago

volcan01010 commented 2 years ago

What happens

Calling load with empty rows parameter causes the program to crash.

What should happen

The function should run but do nothing (as there is nothing to insert)

Potential fix

Return early from function if rows contains no data.

https://github.com/BritishGeologicalSurvey/etlhelper/blob/035fe7c928caf095a24a31a6e0d337809fdec9e9/etlhelper/etl.py#L477