Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Update default accuracy to None to support null JSON values (#1033)
Browse files Browse the repository at this point in the history
* removed required prop on response serializers

* delete Pipfile and Pipfile.lock from root directory,changed default accuracy of tags to None

* change test cases for the default accuracy of tags to None

* refactor indentation to support lint checks

* change help_text of TagSerializer in media_serializers
  • Loading branch information
sahil-R authored Dec 14, 2022
1 parent f9b43fd commit 202e035
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
20 changes: 10 additions & 10 deletions api/catalog/api/examples/audio_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
"filesize": 7139840,
"filetype": "mp3",
"tags": [
{"name": "vocal"},
{"name": "female"},
{"name": "speed_medium"},
{"name": "guitar"},
{"name": "strings"},
{"name": "energetic"},
{"name": "acoustic"},
{"name": "vocal"},
{"name": "voice"},
{"name": "funkyhouse"},
{"accuracy": None, "name": "vocal"},
{"accuracy": None, "name": "female"},
{"accuracy": None, "name": "speed_medium"},
{"accuracy": None, "name": "guitar"},
{"accuracy": None, "name": "strings"},
{"accuracy": None, "name": "energetic"},
{"accuracy": None, "name": "acoustic"},
{"accuracy": None, "name": "vocal"},
{"accuracy": None, "name": "voice"},
{"accuracy": None, "name": "funkyhouse"},
],
"alt_files": None,
"attribution": '"Wish You Were Here" by The.madpix.project is licensed under CC BY-NC-SA 3.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/.', # noqa: E501,
Expand Down
42 changes: 21 additions & 21 deletions api/catalog/api/examples/image_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
"filesize": None,
"filetype": None,
"tags": [
{"name": "tree"},
{"name": "bark"},
{"name": "texture"},
{"name": "wood"},
{"name": "nature"},
{"name": "pattern"},
{"name": "rough"},
{"name": "surface"},
{"name": "brown"},
{"name": "old"},
{"name": "background"},
{"name": "trunk"},
{"name": "natural"},
{"name": "forest"},
{"name": "detail"},
{"name": "lumber"},
{"name": "weathered"},
{"name": "timber"},
{"name": "stump"},
{"name": "closeup"},
{"name": "root"},
{"accuracy": None, "name": "tree"},
{"accuracy": None, "name": "bark"},
{"accuracy": None, "name": "texture"},
{"accuracy": None, "name": "wood"},
{"accuracy": None, "name": "nature"},
{"accuracy": None, "name": "pattern"},
{"accuracy": None, "name": "rough"},
{"accuracy": None, "name": "surface"},
{"accuracy": None, "name": "brown"},
{"accuracy": None, "name": "old"},
{"accuracy": None, "name": "background"},
{"accuracy": None, "name": "trunk"},
{"accuracy": None, "name": "natural"},
{"accuracy": None, "name": "forest"},
{"accuracy": None, "name": "detail"},
{"accuracy": None, "name": "lumber"},
{"accuracy": None, "name": "weathered"},
{"accuracy": None, "name": "timber"},
{"accuracy": None, "name": "stump"},
{"accuracy": None, "name": "closeup"},
{"accuracy": None, "name": "root"},
],
"attribution": None,
"fields_matched": [],
Expand Down
4 changes: 2 additions & 2 deletions api/catalog/api/serializers/media_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ class TagSerializer(serializers.Serializer):
help_text="The name of a detailed tag.",
)
accuracy = serializers.FloatField(
required=False,
default=None,
help_text="The accuracy of a machine-generated tag. Human-generated "
"tags do not have an accuracy field.",
"tags have a null accuracy field.",
)


Expand Down

0 comments on commit 202e035

Please sign in to comment.