do not crash when facing unsupported calendar models #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear Maintainer,
Here is a simple proposal for avoiding crashes in situations when unsupported calendar models are found in wikidata (see issue #54).
The minimalist strategy consist to return the raw dictionary of unsupported calendar models instead of having the program crashing.
See this entity with a Julian birthdate :
This fix do not affect entities with supported calendar models:
I believe this small fix help users to define appropriate strategies when facing unsupported calendar models, instead of having the whole program crash, or having to implement alternative decoders.
Users already need to check date types that could be int, date, datetime, or tuple. They'll may understand that when it is a dictionary, they need to do appropriate processings.
Let me know if you think this proposal is useful and consistent with the philosophy of this project
Kind regards, and thanks again for this usefull framework !