-
Notifications
You must be signed in to change notification settings - Fork 4k
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: Cross Product Recommendations Logic #32003
feat: Cross Product Recommendations Logic #32003
Conversation
### DEFAULT KEY DICTIONARY FOR CROSS_PRODUCT_RECOMMENDATIONS ### | ||
CROSS_PRODUCT_RECOMMENDATIONS_KEYS = {} | ||
|
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.
The dictionary values for each environment will be stored in the edx-internal repository. This PR is for adding in the values for the dictionaries, but it is still a work in progress for getting keys for staging
lms/djangoapps/learner_recommendations/tests/test_serializers.py
Outdated
Show resolved
Hide resolved
lms/djangoapps/learner_recommendations/tests/test_serializers.py
Outdated
Show resolved
Hide resolved
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.
Last few changes otherwise looks good 👍🏽
@ddt.data( | ||
("HKUx+FinTechT1x", ["ColumbiaX+BC24FNTC", "MITx+BLN"]), | ||
("RITx+CYBER501x", ["UniversityofUtah+BC24CYB", "HarvardX+CYB"]), | ||
('NoKeyAssociated', None) | ||
) |
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.
Can we update these course keys to some random test keys? We should avoid using actual course keys in the tests.
course_data = [get_course_data(key, fields) for key in associated_course_keys] | ||
filtered_courses = [course for course in course_data if course] |
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.
- Adding the query string
marketable_course_runs_only': 1
will reduce the size of response and - return course runs for a course that are active. This will help recommend course runs that are active to users and not course runs that a user cannot enroll in.
course_data = [get_course_data(key, fields) for key in associated_course_keys] | |
filtered_courses = [course for course in course_data if course] | |
course_data = [get_course_data(key, fields, querystring={'marketable_course_runs_only': 1}) for key in associated_course_keys] | |
filtered_courses = [course for course in course_data if course and course_data.get("course_runs")] |
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
EdX Release Notice: This PR has been deployed to the production environment. |
1 similar comment
EdX Release Notice: This PR has been deployed to the production environment. |
Is this feature available in open edX installations, or does it depend on a commercial service? None of the linked docs are public so I can't tell. |
It's not and has now been moved to private plugin. |
Description
This PR encompasses our initial logic for our Personalised Cross Product Recommendation Upsell project. It consists of adding a new endpoint to the learner recommendation app where associated course data is returned based on the key provided to the endpoint.
Key additions are a new view, utility method, and serializer that utilises fields from an existing serializer, but houses an extra field, "course_type". The experiment will be targeted towards anonymous user and will include course filtering based on their location.
Example of a successful response from the endpoint using dummy data:

Supporting information
Finishes PTECH-3169, PTECH-3170, PTECH-3171, PTECH-3172, PTECH-3190
PR for adding dictionary values
Testing instructions
We tested this endpoint by adding an entry to the
CROSS_PRODUCT_RECOMMENDATIONS_KEYS
settings variable of one course key associated to an array of two course keys, eg"TESTx+KEYx": ["TESTx+KEYy", "TESTx+KEYz]
. These course keys will need to obviously be of courses that are present in your local dev environment. Then we query the endpoint/api/learner_recommendations/cross_product/<course_id>/
and then expect back an array of two courses, or an empty array of courses.