Aggregate Instructor Query for Penn Reviews #669
+594
−383
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Developed a new endpoint
/api/review/instructors/analysis/
to Penn Course Review to query and retrieve a list of top instructors, either within a specified department or across all departments, based on their performance statistics, primarily focusing on maximum average ratings.The functionality allows users to specify a range between start and end semesters, or defaults to the complete available data set. it filters the
Review
objects based on optional parameters such as department and semester range, using the previously-builtreview_averages
function to compute statistics and aggregate them with appropriate annotations. The endpoint was also successfully tested through unit tests.Possible considerations include the performance implications of the initial data retrieval process, which pulls all Review objects before filtering. This could lead to increased runtime or memory usage, particularly with a large dataset, as each query's complexity scales with the number of reviews.