Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@wderocco8
Copy link
Member

What does this PR do?

Had to fix some issues in backend handling edge cases for insights (e.g. missing applicants, no gpas, no gradYears, no majors). Added unit tests for missing applicants and missing gpas (the others aren't testable right now because there are frontend restrictions that guarantee inclusion of gradYear and major for everyone.

Type of change

  • Fix: Bug fix (non-breaking change which fixes an issue)
  • Refactor: Any code refactoring
  • Chore: technical debt, workflow improvements
  • Feature: New feature (non-breaking change which adds functionality)
  • Documentation: This change requires a documentation update
  • Merge: Pushing features to an upper envrironment

Tests Performed

Created new unit tests via pytest for missing applicants and missing gpas

Screenshots

image

Additional Comments

@github-actions
Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
990 849 86% 80% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
chalicelib/services/InsightsService.py 94% 🟢
tests/api/test_insights.py 100% 🟢
tests/services/test_insights_service.py 100% 🟢
TOTAL 98% 🟢

updated for commit: b765ba8 by action🐍

Copy link
Contributor

@jinyoungbang jinyoungbang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks great! Just have a minor feedback in data consistency and one of the JSON files but once you fix that, I think we should be good to go :)

Ideally, client should see a null value and based off of that, render a value properly.

if count_gpa:
avg_gpa /= count_gpa
else:
avg_gpa = "N/A"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using None is a better choice instead of using strings – having multiple datatypes being returned isn't too good of a practice

@@ -0,0 +1 @@
[] No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary to create this! In the fixture itself, you can always check for an empty array instead of loading a file and reading it!

@wderocco8 wderocco8 merged commit 5558864 into dev/v0.2 Feb 18, 2024
@wderocco8 wderocco8 deleted the fix/insights-edge-cases branch February 18, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants