Then, using the following code to convert an instance of RecordWithUnions to json and back again:
import yay
converter = yay.ndjson.RecordWithUnionsConverter()
json = converter.to_json(yay.RecordWithUnions())
r = converter.from_json(json)
The last line throws:
Traceback (most recent call last):
File "/workspaces/yardl/joe/issue-#113/python/test.py", line 7, in <module>
r = converter.from_json(json)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspaces/yardl/joe/issue-#113/python/yay/ndjson.py", line 58, in from_json
aliased_value=self._aliased_value_converter.from_json(json_object["aliasedValue"],),
~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'aliasedValue'
Using yardl v0.4.0, if you add an aliased nullable union to a Protocol sequence, the NDJSON reader will crash if the value of that step is
None
.Example:
Then, using the following code to convert an instance of
RecordWithUnions
to json and back again:The last line throws: