bridge-in-tech-backend
bridge-in-tech-backend copied to clipboard
Improvement: refactor expected_fields_validator
Description
As a developer, I need validators to be fast, so that API response time will be less.
Mocks
https://github.com/anitab-org/bridge-in-tech-backend/blob/68d8ff9a8640cef1d3e53b2b0dd9b80e3d750fd7/app/utils/validation_utils.py#L157-L164
The two for loops can be implemented efficiently by using the python built-in function.
I think there is no need for two for
loops for this.
Acceptance Criteria
Update [Required]
- [ ] Remove two
for loops
. - [ ] Use python builtin function to return the actual validation (described in docstrings of function).
Definition of Done
- [ ] All of the required items are completed.
- [ ] Approval by 1 mentor.
Estimation
0.5 hours
@codesankalp I would like to work on this issue.
@KushalBeniwal Have you completed the mandatory setup task #244 before claiming a coding/testing issue?
@decon-harsh, no, I haven't. I will do that first.
@KushalBeniwal comment once you do the setup task
I am unable to follow from this step https://github.com/anitab-org/bridge-in-tech-backend/blob/develop/.github/ENV_SETUP_INSTRUCTION.md#4th-open-pgadmin4, as I am using wsl, so, I can only use the command line.
I am unable to follow from this step https://github.com/anitab-org/bridge-in-tech-backend/blob/develop/.github/ENV_SETUP_INSTRUCTION.md#4th-open-pgadmin4, as I am using wsl, so, I can only use the command line.
Please join our zulip chat and ask your doubts there, we will be happy to help you with your Dev env setup. @KushalBeniwal
I would like to work on this issue if is available, but I have a question. user_input
and data_model
are always int
arrays, right?
Hi @epicadk or @mtreacy002 a maybe possible solution could be to use the data structure set to compare if user_input and data_model are exact the same, however, I saw that in tests are falling, but the problem apparently is the code, so, I have a question, I need to verify that always user input fields contain only the expected fields of the data model? not more and not less right?, I have that doubt because so I think that I found an error in the code but I am not sure
@y-martinez , can you please explain what you mean with
I need to verify that always user input fields contain only the expected fields of the data model? not more and not less right?, I have that doubt because so I think that I found an error in the code but I am not sure
@y-martinez any updates?