I was digging through the experiment model while updating the SRA parser and was curious about default values when I noticed that the Experiment.protocol_description is a JSONField column in the database which has an empty dict as the default value.
Problem or idea
Depending on the results from looking further into how this is used, we should either update the column type to match the content (TextField) or store all protocol_descriptions as JSON values, whichever is more appropriate. We are most likely incurring a minor performance penalty. Either way having strings in a JSONField could lead to errors down the line.
Solution or next step
Check to see if we actually use this field as a JSON field for any experiments / sources.
If we don't we should migrate the field to a TextField.
If we do, we should migrate so that all protocol_descriptions are JSON values
Context
I was digging through the experiment model while updating the SRA parser and was curious about default values when I noticed that the Experiment.protocol_description is a JSONField column in the database which has an empty dict as the default value.
Problem or idea
Depending on the results from looking further into how this is used, we should either update the column type to match the content (TextField) or store all
protocol_descriptions
as JSON values, whichever is more appropriate. We are most likely incurring a minor performance penalty. Either way having strings in a JSONField could lead to errors down the line.Solution or next step
TextField
.protocol_descriptions
are JSON values