-
-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Issue:
When some object in the database is missing a field marked as mandatory, the fetch fails.
It's possible to fetch the same data using a simple curl command, or accessing on a web-browser.
Via the python SDK it fails with a dacite.Exception.MissingValueError on the fetch in Endpoint.py->get function, utils.py->fetch function. It is able to get the info from the URL, but it fails in the call to the _from_dict function due to not having a field that's marked as mandatory in the interfaces file.
NOTE: Apologies for not providing a full stack dump, as I do not have it available at the moment, but can add it to this issue if needed.
Reproducing and specific scenario:
I came across this error when I was iterating all Series and Sets from various languages to build a comprehensive list.
When getting the full set from the setResume, is when the SDK fails.
In this case:
Language: fr
Series_id: tcgp
Set_id: P-A
This set does have boosters but not have fr name for booster:
boosters: { vol1: { name : { en: 'Vol. 1' } },
so that field is returned empty from the API but as we have in the interfaces:
boosters?: Record<string, { name: Languages<string> }>
This makes it that although 'boosters' field is optional, if it exists, the name field is mandatory, which is why it crashes when building the 'object' to be returned, in the dacite.core.py with the aforementioned exception.
I'm fully available, here, and in the Discord server for more clarification if needed.