diff --git a/parsons/etl/etl.py b/parsons/etl/etl.py index 39df7a5044..e9647fb7a1 100644 --- a/parsons/etl/etl.py +++ b/parsons/etl/etl.py @@ -181,11 +181,16 @@ def convert_columns_to_str(self): cols = self.get_columns_type_stats() + def str_or_empty(x): + if x is None: + return "" + return str(x) + for col in cols: # If there's more than one type (or no types), convert to str # Also if there is one type and it's not str, convert to str if len(col['type']) != 1 or col['type'][0] != 'str': - self.convert_column(col['name'], str) + self.convert_column(col['name'], str_or_empty) return self