Skip to content

Commit

Permalink
Add annotation for skipped errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yalef committed Feb 5, 2024
1 parent 965b8bc commit 966ae3f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
from ... import models


class SkippedErrorsDict(typing.TypedDict):
"""Typed dict for skipped errors."""
non_field_skipped_errors: list[str]
field_skipped_errors: dict[str, list[str]]


class ImportParamsSerializer(serializers.Serializer):
"""Serializer for representing import parameters."""
data_file = serializers.FileField()
Expand Down Expand Up @@ -172,7 +178,7 @@ def to_representation(self, instance: models.ImportJob):
not in models.ImportJob.results_statuses
):
return super().to_representation(self.get_initial())
skipped_errors = {
skipped_errors: SkippedErrorsDict = {
"non_field_skipped_errors": [],
"field_skipped_errors": {},
}
Expand Down

0 comments on commit 966ae3f

Please sign in to comment.