mentorship-backend icon indicating copy to clipboard operation
mentorship-backend copied to clipboard

Enhancement: Use Enum Representation in Mentorship Relation

Open devkapilbansal opened this issue 3 years ago • 8 comments

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

devkapilbansal avatar Sep 16 '21 17:09 devkapilbansal

I would like to work on this issue. can you suggest me some hints?

msaini28r avatar Oct 14 '21 08:10 msaini28r

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

devkapilbansal avatar Oct 19 '21 11:10 devkapilbansal

Unassigning @msaini0r due to inactivity

vj-codes avatar Feb 28 '22 20:02 vj-codes

Hello! Is this issue still available? If so, i would like to work on it!

mariejp avatar Apr 08 '22 20:04 mariejp

Hi! I also sent a message in the Zulip, but am I able to be assigned to work on this issue?

ciheanyi avatar Apr 08 '22 20:04 ciheanyi

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!

ciheanyi avatar Apr 14 '22 16:04 ciheanyi

Can you open a pr so we can help you out?

epicadk avatar Apr 14 '22 16:04 epicadk

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.

ciheanyi avatar Apr 22 '22 15:04 ciheanyi