You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you set skip_unchanged = True, you are saying that any rows that have not changed wrt to the persisted instance should be skipped (this is reported in the import results).
If you import a field which will fail validation (e.g. a bad date format), then this correctly raises a ValidationError, this is also reported in the import results.
However, if you set skip_unchanged=True and you have a field with a bad date format, you do not see the ValidationError in the results, instead the row is marked as skipped.
This is a bug because:
The ValidationError should be reported.
The row should be marked as invalid not skipped (the incoming data is modified wrt to persisted data).
This occurs because the validate_instance() method is only called if skip_row() returns False.
To Reproduce
Create a Resource with skip_unchanged=True
Create an instance of an existing entity (e.g. Author)
Describe the bug
If you set
skip_unchanged = True
, you are saying that any rows that have not changed wrt to the persisted instance should be skipped (this is reported in the import results).If you import a field which will fail validation (e.g. a bad date format), then this correctly raises a
ValidationError
, this is also reported in the import results.However, if you set
skip_unchanged=True
and you have a field with a bad date format, you do not see theValidationError
in the results, instead the row is marked as skipped.This is a bug because:
This occurs because the
validate_instance()
method is only called ifskip_row()
returns False.To Reproduce
skip_unchanged=True
Failing test case here.
Versions (please complete the following information):
Expected behavior
ValidationErrors should be reported in the result. Invalid rows should not be skipped.
The text was updated successfully, but these errors were encountered: