AlexsLemonade / AlexsLemonade/refinebio
Experiment.protocol_description is a JSONField
- Dominant language
- Python
- Stars
- 135
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
### 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
- 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
Contributor guide
No contributing guide indexed for this repository
Research direction
Locate the Experiment model and search for protocol_description and protocol_descriptions usages across the project. Inspect existing stored values and database migrations to determine whether the field is used as JSON; done means the column type and stored values consistently match the chosen representation, with migration coverage for existing data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- database
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100