Compatibility to old data schemas
With the versioning of the data schema (see issue #127 (closed)) backwards compatibility must be provided in the default class.from_dict()
methods of the serialization classes. Currently, there are no alternative from_dict()
methods for alternative data schemas. There should be a mechanism to switch to alternative versions (from the support list) and enable backward compatibility.
In every firework there is a key '_data_schema_version'
that is added when the firework is created and referring to the version used to write data from that firework. Data received from parent fireworks may have other schemas. One way to implement the compatibility mechanism is to pass a compatibility version as a parameter of from_dict()
to delegate to the relevant deserialization method call to from_<version>()
. In the following example a
and c
will be retrieved from two different older versions mapped by a->node 1->version 1
and c->node 2->version 2
.
node 2, data c, version 2 ----+
|
v
node 1, data a, version 1 --> node 3, data b = f(a, c), version 3
If we have this mechanism, also automatic batch-like version conversion will be possible. All data sections will be read with the from_dict()
methods of the specified schema versions and then overwritten in the new schema version.