Closed jas-ho closed 1 year ago
simple fix: tighten from if value
to if value is not None
in context.py:122
...but maybe it's better to just drop line 122 altogether and even explicitly set None
values on the output dict?
You are right "is not None" is missing. Probably we can add a flag "has_result" into Context class to serialize .result only if context really has a result to allow "None" as a proper result. But missing result and having state FINISHED or EVENT means result is None. Nevertheless, I do not like idea to create key "result" (in serialized form) for a context that does not actually have a result.
Hey @jas-ho, thanks for the issue and the fix!
A technical note, please prefer rebases to merges:
main
has moved in the meantime (no information is lost here with a rebase except maybe for timing, and errors get caught early), andmain
. (this is caller rebase+merge on github. Doing mere or rebase here is more debated, and I prefer rebases, but works for me either way.)Otherwise history gets this tangled just for a simple fix/improvement.
[...]
fails on empty string and
0
, since in those casesc.result
is not set in the dict resulting from call toto_dict