mentorship-backend
mentorship-backend copied to clipboard
Enhancement: Use Enum Representation in Mentorship Relation
Description
I want to ensure that the database queries are fast and take less space for storage.
https://github.com/anitab-org/mentorship-backend/blob/8924616fa20d5d37026f48ef1481e00932622b2a/app/api/dao/mentorship_relation.py#L139
In the code above :point_up: , we are using string values for relation state which should be avoided.
Definition of Done
- [ ] All of the required items are completed.
- [x] Approval by 1 mentor.
Estimation
5-6 hours
I would like to work on this issue. can you suggest me some hints?
Sure @msaini0r
Here, you will have to use numerical mapping of values with valid_states. Currently, we are storing string values that should be converted to 0,1,2... to save space
Check this file to have a clear idea of what is needed :point_down: https://github.com/anitab-org/mentorship-backend/blob/develop/app/utils/enum_utils.py
Unassigning @msaini0r due to inactivity
Hello! Is this issue still available? If so, i would like to work on it!
Hi! I also sent a message in the Zulip, but am I able to be assigned to work on this issue?
Hi! Thanks so much for assigning, so I finished writing the code for the enum 🥳 and I was wondering how I can go about testing before I request to push. I was a bit confused if there was some sort of suite or ready made test cases, if anybody could direct me to the right place!
Can you open a pr so we can help you out?
Whoops, realized I put this in my request not here. @epicadk @isabelcosta
But just dropping this again for a review for the pull request. I also think there may be some software updates required that are causing the unit tests to fail, I believe markup may have recently moved to a new version that causes jinja2 to fail. When we downgraded the libraries locally, the unit tests ran successfully.