You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the ISIS serial number translation logic, the SQLAlchemy model converts the PVL translation string into a NextedJsonObject which removes duplicate keys such as the multiple translations. Then, the JSON object gets turned back into a PvlModule. This results in strange behavior like the Galileo translation going from:
This in turn results in invalid serial numbers because the value on the label is "Galileo Orbiter" and instead of getting "Galileo" as the first keyword, you get "Galileo Orbiter".
The text was updated successfully, but these errors were encountered:
I think the trick here is to store the translation PVL as a string type in the DB and then to lean more heavily on the PVL library to encode/decode on read/write. That will maintain the duplicate keys.
As a more meta question - what options exist to avoid using duplicate keys in the translation tables? Duplicate keys are quite problematic for JSON (most, but not all implementations as duplicate keys are not explicitly prohibited), YAML, python dicts, and likely more). If we needed to encode this as JSON, we could use an array:
Yes, they are processed from top to bottom, so order could be important, but I don't know of any cases like that. The first one that works is the winner.
In the ISIS serial number translation logic, the SQLAlchemy model converts the PVL translation string into a NextedJsonObject which removes duplicate keys such as the multiple translations. Then, the JSON object gets turned back into a PvlModule. This results in strange behavior like the Galileo translation going from:
to
This in turn results in invalid serial numbers because the value on the label is "Galileo Orbiter" and instead of getting "Galileo" as the first keyword, you get "Galileo Orbiter".
The text was updated successfully, but these errors were encountered: