Would need to see your code to be sure, but I am gong to guess you are trying to CAST the string to integer in the SQL e.g CAST(some_str_value AS INTEGER) or some_str_value::integer. The error you are getting is :
test=# select CAST('' AS INTEGER); ERROR: invalid input syntax for integer: "" LINE 1: select CAST('' AS INTEGER); ^ test=# select ''::integer; ERROR: invalid input syntax for integer: "" LINE 1: select ''::integer;
Two options:
1) You will need the catch the '' on the Python side before they get to the database and turn them into None(if Nulls allowed in column) or 0 otherwise.
2) If possible convert the integer column on the destination db to a varchar one. Though I would do some investigation before doing this as this may very well mess up other code.