Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Suggestion to fix: Validation warning handling None values #51

Description

@llikaj17

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions