Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Use Enum Representation in Mentorship Relation #1143

Open
1 of 2 tasks
devkapilbansal opened this issue Sep 16, 2021 · 8 comments
Open
1 of 2 tasks

Enhancement: Use Enum Representation in Mentorship Relation #1143

devkapilbansal opened this issue Sep 16, 2021 · 8 comments
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Type: Enhancement New feature or request.

Comments

@devkapilbansal
Copy link
Member

devkapilbansal commented Sep 16, 2021

Description

I want to ensure that the database queries are fast and take less space for storage.

valid_states = ["PENDING", "ACCEPTED", "REJECTED", "CANCELLED", "COMPLETED"]

In the code above ☝️ , we are using string values for relation state which should be avoided.

Definition of Done

  • All of the required items are completed.
  • Approval by 1 mentor.

Estimation

5-6 hours

@devkapilbansal devkapilbansal added Status: Available Issue was approved and available to claim or abandoned for over 3 days. Type: Enhancement New feature or request. python Pull requests that update Python code labels Sep 16, 2021
@msaini28r
Copy link

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

@devkapilbansal
Copy link
Member Author

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 👇
https://github.com/anitab-org/mentorship-backend/blob/develop/app/utils/enum_utils.py

@devkapilbansal devkapilbansal removed the Status: Available Issue was approved and available to claim or abandoned for over 3 days. label Oct 19, 2021
@vj-codes
Copy link
Member

Unassigning @msaini0r due to inactivity

@vj-codes vj-codes added Status: Available Issue was approved and available to claim or abandoned for over 3 days. and removed python Pull requests that update Python code labels Feb 28, 2022
@mariejp
Copy link

mariejp commented Apr 8, 2022

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

@ciheanyi
Copy link

ciheanyi commented Apr 8, 2022

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

@epicadk epicadk removed the Status: Available Issue was approved and available to claim or abandoned for over 3 days. label Apr 9, 2022
@ciheanyi
Copy link

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!

@epicadk
Copy link
Member

epicadk commented Apr 14, 2022

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

@ciheanyi
Copy link

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.

@vj-codes vj-codes added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack labels Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Open Source Hack Type: Enhancement New feature or request.
Projects
None yet
Development

No branches or pull requests

6 participants