@long2ice As part of #459 I've been looking at the revision history for the Coder.decode_as_type method. Support for decoding JSON to a custom return type was added in commit f78a599b by @mjpieters in May 2023 but then removed again in commit 19c4d027 by John Lyu (whose GitHub account doesn't seem to exist anymore).
Was this intentional?
As it stands right now, the current JsonCoder unit tests will never pass in their current form for a dataclass or a Pydantic model because decoding to a custom return type is no longer implemented and the type_ parameter is never used.
Unless I'm missing something which is entirely possible. For now I'll comment out those specific test values and focus on the failing test for the @cache decorator but it would be good to know the history behind this.
The same applies to decoding back to a tuple as the closest JSON analogue is an array, so both a Python list and a tuple will always encode to an array and decode back to a list.
@long2ice As part of #459 I've been looking at the revision history for the
Coder.decode_as_type
method. Support for decoding JSON to a custom return type was added in commit f78a599b by @mjpieters in May 2023 but then removed again in commit 19c4d027 by John Lyu (whose GitHub account doesn't seem to exist anymore).Was this intentional?
As it stands right now, the current
JsonCoder
unit tests will never pass in their current form for a dataclass or a Pydantic model because decoding to a custom return type is no longer implemented and thetype_
parameter is never used.Unless I'm missing something which is entirely possible. For now I'll comment out those specific test values and focus on the failing test for the
@cache
decorator but it would be good to know the history behind this.