The object model currently raises error when expected keys are not present in a given payload dictionary received. This is fine since the current object representation is closely tied to the payload itself.
However, if a new field is added (as was done for ASP rank with ps2/characters and the prestige_level field), the object model currently quietly ignores the extraneous key.
Potential solution
We could change the auraxium.base.Ps2Data.from_census() method(s) in the object model to use dict.pop() rather than direct member access or dict.get(). That way, any expected keys are consumed, and any leftovers are new, fresh, and might provoke some form of UnexpectedPayloadWarning.
Things to look out for:
We might want to use a copy of the source dictionary when .pop()-ing out keys, since that payload might be reused elsewhere
This also flags joins as "unexpected keys". We could filter out keys with _join_ in them, since the object model never creates any custom-named joins
The object model currently raises error when expected keys are not present in a given payload dictionary received. This is fine since the current object representation is closely tied to the payload itself.
However, if a new field is added (as was done for ASP rank with
ps2/characters
and theprestige_level
field), the object model currently quietly ignores the extraneous key.Potential solution
We could change the
auraxium.base.Ps2Data.from_census()
method(s) in the object model to usedict.pop()
rather than direct member access ordict.get()
. That way, any expected keys are consumed, and any leftovers are new, fresh, and might provoke some form ofUnexpectedPayloadWarning
.Things to look out for:
.pop()
-ing out keys, since that payload might be reused elsewhere_join_
in them, since the object model never creates any custom-named joins