Skip to content

dataclass_wizard.errors.UnknownJSONKey: A JSON key is missing from the dataclass schema for class Video. unknown key: 'tags' #75

@KaneDM

Description

@KaneDM
  • Wistia API Helper version: Latest
  • Python version: 3.11
  • Operating System: Win 10

Description

Crashed while running my Wistia upload/HTML dump script, which has worked previously. Code here:
https://github.com/KaneDM/wistia-upload-embed/blob/main/tvid.py

The video was uploaded successfully, and the thumbnail was successfully created and assigned, but something went wrong during the thumbnail assignment.

What I Did

Crashed on line 83 of my script, where I call WistiaApi.update_video(vidid, thumbnail_media_id=tn.hashed_id).

Traceback (most recent call last):
  File "D:\Python\tvid.py", line 83, in <module>
    WistiaApi.update_video(vidid, thumbnail_media_id=tn.hashed_id)
  File "C:\Python311\Lib\site-packages\wystia\api_data.py", line 347, in update_video
    return cls.update_media(
           ^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\wystia\api_data.py", line 396, in update_media
    return model_cls.from_dict(r.json())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\dataclass_wizard\loaders.py", line 536, in fromdict
    return load(d)
           ^^^^^^^
  File "C:\Python311\Lib\site-packages\dataclass_wizard\loaders.py", line 611, in cls_fromdict
    field_name = lookup_field_for_json_key(o, json_key)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\dataclass_wizard\loaders.py", line 705, in lookup_field_for_json_key
    raise e from None
dataclass_wizard.errors.UnknownJSONKey: A JSON key is missing from the dataclass schema for class `Video`.
  unknown key: 'tags'
  dataclass fields: ['hashed_id', 'id', 'name', 'type', 'created', 'updated', 'duration', 'status', 'description', 'progress', 'thumbnail', 'project', 'embed_code', 'assets', 'section', 'archived', 'has_audio_description', 'captions_enabled', 'overlay_text', 'caption_duration', 'num_captions', 'ad_disabled']
  input JSON object: {"id": 113495448, "name": "Blep", "type": "Video", "archived": false, "created": "2023-12-22T19:27:51+00:00", "updated": "2023-12-22T19:27:52+00:00", "duration": 1583.04, "hashed_id": "d8wh65z917", "description": "", "progress": 0.14285714285714285, "status": "queued", "thumbnail": {"url": "https://embed-ssl.wistia.com/deliveries/955004dbcdfd7aef4f136c28c495f0df.jpg?image_crop_resized=200x120&video_still_time=791", "width": 200, "height": 120}, "tags": []}

Appears to be the same kind of problem as issue #59.

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