Validation error doesn't print row, column and value if value is None.
For instance, for DateType checks which should handle null values, the error printed is as follows:
0,This field should be date type
instead of
0,"{row: 1, column: ""Date_column""}: ""None"" This field should be date type"
This issue is due to ValidationWarning class (in validation_warning.py) which is ignoring None for the value and prints the generic message. Instead of ignoring None for the value, we could change the value to string in order to print the row and column as it should.
Before:
# line 19: ValidationWarning at validation_warning.py
if self.row is not None and self.column is not None and self.value is not None:
return '{{row: {}, column: "{}"}}: "{}" {}'.format(self.row, self.column, self.value, self.message)
else:
return self.message
After:
# line 19: ValidationWarning at validation_warning.py
if self.row is not None and self.column is not None:
value = self.value if self.value is not None else "None"
return '{{row: {}, column: "{}"}}: "{}" {}'.format(self.row, self.column, value, self.message)
else:
return self.message
Validation error doesn't print row, column and value if value is None.
For instance, for DateType checks which should handle null values, the error printed is as follows:
0,This field should be date type
instead of0,"{row: 1, column: ""Date_column""}: ""None"" This field should be date type"
This issue is due to
ValidationWarning
class (invalidation_warning.py
) which is ignoring None for the value and prints the generic message. Instead of ignoring None for the value, we could change the value to string in order to print the row and column as it should.Before:
After: