-
Notifications
You must be signed in to change notification settings - Fork 172
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
ENT-8400: Added transcript_languages_search_facet_names to CourseRunSerializer #4296
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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 field name is not good/descriptive -- if you want language names only, it should be transcript_language_names. Though I don't know why we need a new field for this -- when we have language info already available.
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.
@DawoudSheraz The field name
transcript_languages_search_facet_names
suggests that it's specifically for Algolia search facets. We already have language information (stored in the transcript_languages attribute) in the form of language codes. Now, we need to extract language names from these codes to store in Algolia.That's why we introduced this new variable, which indicates that it contains language names mapped to each language code, specifically for use in Algolia search facets.
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.
If it is only needed for Algolia(and for enterprise usage), the API is not the right place to add this information. It should be done on Enterprise algolia code level.
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.
@DawoudSheraz In past, this approach has been explored here where the catalog can use the langcodes method to convert language codes into human-readable names. However, this method didn't align perfectly with the
LanguageTag
model data stored in thecourse-discovery
database and in order to sync it, we would need to replicate the LanguageTag model in the catalog.A similar strategy has been used previously for similar tasks (here). Language names were included in the CourseRunSerializer within course-discovery. This setup allows the enterprise-catalog to retrieve language names seamlessly through the API endpoint, eliminating the need to parse language codes or replicate the LanguageTag model from course-discovery.
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.
And
both seem to be referring to same PR? Anyways, while I get the context, I would suggest finding a better way for doing this. I personally do not agree with how it has been done in the past 🙂 . Discovery APIs already carry too much information and adding an new field for a very specific consumer is not worth it.
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.
@DawoudSheraz Alternative approaches that have been considered in the past are listed in the PR.
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.
@DawoudSheraz I will discuss with team markhors, and going forward, we will explore more effective methods of obtaining this information. Currently, replicating such information in the catalog seems like a substantial effort. Could you please confirm if these changes are ready for deployment at this time, and we can work on refining the approach in the future?