-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: adding course review metrics to content metadata and algolia index #735
Conversation
12106bf
to
2450c9e
Compare
7fbd4a3
to
3633ef5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once tests pass! 🚢
with self.assertRaises(requests.exceptions.RequestException): | ||
client._retrieve_course_reviews(request_params) | ||
|
||
assert 'Retrieving course reviews from course-discovery for page 1...' in mock_logger.info.call_args.args[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asserting log lines is less preferable than asserting the mocks are called with a specific input or some outcome/side-effect is observed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed for a mock called assertion
@@ -80,6 +81,75 @@ def _retrieve_metadata_for_content_filter(self, content_filter, page, request_pa | |||
break | |||
return response.json() | |||
|
|||
def _retrieve_course_reviews(self, request_params): | |||
""" | |||
Makes a request to discovery's /api/v1/course_review/ paginated endpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this endpoint paginated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
locally testing it seems so?
if run.get('uuid') == course_run_uuid: | ||
run.update({'start': start_date, 'end': end_date}) | ||
|
||
# Perform more steps to normalize and move keys around for more consistency across content types. | ||
_normalize_course_metadata(metadata_record) | ||
|
||
if review := reviews_for_courses_dict.get(content_key): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviews_for_courses_dict
is a list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope- get_course_reviews
should return a dictionary
00643ed
to
04457f3
Compare
04457f3
to
21d6c12
Compare
…iews feat: adding course review metrics to content metadata and algolia index
Ticket Link
Link to the associated ticket
https://2u-internal.atlassian.net/browse/ENT-8126
Post-review