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

Skip to content

Conversation

@wderocco8
Copy link
Member

@wderocco8 wderocco8 commented Feb 10, 2024

What does this PR do?

Created an InsightsService and corresponding API endpoint to perform all data analysis in the backend. Kept a similar code structure to the frontend code, but added some additional checks for null/empty values.

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 environment

Tests Performed

Planning to experiment with some unit tests, but for now just tested directly using a new listing "Big Data"

UPDATE: completed unit tests for both api and InsightsService

Screenshots

https://drive.google.com/file/d/1f6k0tTP6ERyQY8Ddyw2hNDcYdDwC7Qc6/view?usp=sharing

Additional Comments

@wderocco8 wderocco8 changed the base branch from main to dev/v0.2 February 10, 2024 17:46
@github-actions
Copy link

github-actions bot commented Feb 10, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
946 806 85% 80% 🟢

New Files

File Coverage Status
chalicelib/api/insights.py 100% 🟢
chalicelib/services/InsightsService.py 95% 🟢
tests/api/test_insights.py 100% 🟢
tests/services/test_insights_service.py 100% 🟢
TOTAL 99% 🟢

Modified Files

File Coverage Status
app.py 100% 🟢
TOTAL 100% 🟢

updated for commit: a29b9db by action🐍

@wderocco8 wderocco8 marked this pull request as draft February 10, 2024 17:47
@wderocco8 wderocco8 marked this pull request as ready for review February 15, 2024 05:36
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.

LGTM! Just two minor changes:

  1. Can you switch camel case to snake case? https://www.pluralsight.com/blog/software-development/programming-naming-conventions-explained
  2. Make sure you create a test case to handle your exception
Screenshot 2024-02-15 at 4 25 44 PM

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.

LGTM! Added a minor comment but not necessary to change haha

giphy (2)

common_grad_year, count_common_grad_year = "", 0

# update most common major
for major, freq in majors.items():
Copy link
Contributor

Choose a reason for hiding this comment

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

some cool tips: max(data.items(), key=lambda x: x[1])

you could do something like this and manipulate this data to get the maximum/most common item of a dictionary! (a simple one liner)

Copy link
Member Author

Choose a reason for hiding this comment

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

dang, man's pulled out the lambda funcion 😂

Copy link
Member Author

Choose a reason for hiding this comment

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

damn that actually just cut like 15 lines of code lmaoooo

@wderocco8 wderocco8 merged commit c6fbfee into dev/v0.2 Feb 16, 2024
@wderocco8 wderocco8 deleted the feat/data-analytics branch February 16, 2024 16:25
@jinyoungbang jinyoungbang added the improvement Enhancements label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants