Open BouchaaraAdil opened 4 years ago
Hi @BouchaaraAdil, you could try:
temp_table1 = etl.convert(temp_table, 'startTimeTS', lambda v, row: self.calc_starttime(row.created_at, row.startTime), pass_row=True, failonerror=True)
This will cause petl to propagate an except if one is raised by the conversion function.
The failonerror
argument can be False
(default), True
(raise any exception immediately) or "inline"
(use exceptions as values in the table). If you want to set the behaviour globally, you can do:
petl.config.failonerror = True
Reopening: not related to #484
Minimal, reproducible code sample, a copy-pastable example if possible
Problem description
I'm working on data migration from MySQL to Postgres and wanted to convert NULL fields for rows I coded a separated function that I need to call in etl.convert,
Version and installation information
petl==1.3.0
Python 3.7.4
linux