Skip to content

Commit 786a589

Browse files
authored
Merge pull request #174 from openedx/saleem-latif/ENT-7234-updates
fix: Fixed some implementation issues in job recommendation logic.
2 parents c7c4182 + c853898 commit 786a589

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGELOG.rst

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Change Log
1313
1414
Unreleased
1515

16+
[1.43.3] - 2023-08-02
17+
---------------------
18+
* fix: Fixed some implementation issues in job recommendation logic.
19+
1620
[1.43.2] - 2023-08-01
1721
---------------------
1822
* perf: Further performance enhancements for the algolia index command.

taxonomy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
# 2. MINOR version when you add functionality in a backwards compatible manner, and
1616
# 3. PATCH version when you make backwards compatible bug fixes.
1717
# More details can be found at https://semver.org/
18-
__version__ = '1.43.2'
18+
__version__ = '1.43.3'
1919

2020
default_app_config = 'taxonomy.apps.TaxonomyConfig' # pylint: disable=invalid-name

taxonomy/algolia/constants.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
'searchable(skills.name)',
1717
'searchable(industry_names)',
1818
'searchable(b2c_opt_in)'
19+
'searchable(job_sources)'
1920
],
2021
}
2122

taxonomy/algolia/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ def calculate_job_recommendations(jobs_data):
113113
Note: `jobs_data` will be treated as mutable (instead of creating a new dict to return)
114114
to reduce memory footprint of this function.
115115
116-
Args:
116+
Arguments:
117117
jobs_data (dict<str: dict>): A dictionary containing jobs data like skills. key of the dict is jobs name and
118118
the value dict should at-least contain a set of skills against `skills` key.
119119
120120
Returns:
121121
(dict<str: dict>): The same dict from the argument, with `similar_jobs` added against each job.
122122
"""
123123
SIMILAR_JOBS_COUNT = 3
124-
job_recommendations = deque([], maxlen=SIMILAR_JOBS_COUNT)
125124
for job_name, job in jobs_data.items():
125+
job_recommendations = deque([], maxlen=SIMILAR_JOBS_COUNT)
126126
for candidate_job_name, candidate_job in jobs_data.items():
127127
if job_name == candidate_job_name:
128128
continue
@@ -131,7 +131,7 @@ def calculate_job_recommendations(jobs_data):
131131

132132
insert_item_in_ordered_queue(
133133
queue=job_recommendations,
134-
item=JobRecommendation(job_name, jaccard_similarity),
134+
item=JobRecommendation(candidate_job_name, jaccard_similarity),
135135
key=lambda item: item.similarity,
136136
)
137137

0 commit comments

Comments
 (0)