Skip to content

fix(recommender):Fix skill duplicate AFTER - #1937

Merged
komalharshita merged 3 commits into
komalharshita:mainfrom
jerry-kay19:fix-skill-duplicate
Sep 19, 2026
Merged

komalharshita merged 3 commits into
komalharshita:mainfrom
jerry-kay19:fix-skill-duplicate

Conversation

@jerry-kay19

Copy link
Copy Markdown
Contributor

Summary [required]

This resolves an issue parse_skill_entries() where passing comma-seperated skill aliases that map to identical tokens that create duplicate entries in the resulting list.

Related Issue [required]

Closes #

Type of Change [required]

  • [ .] Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • [ .] Test — adds or updates tests

What Was Changed [required]

File Change made
`src/utils/recommender.py Added deduplication logic using dictionary keys after synonym resolution
tests/test_basic.py Added test_parse_skill_entries_deduplicates_synonyms to verify alias deduplication

How to Test This PR [required]

test_parse_skill_entries_deduplicates_synonyms to verify alias deduplication

  1. Clone this branch: git checkout your-branch-name
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. Open http://127.0.0.1:5000 and...
  5. Run the tests: python tests/test_basic.py

Expected test output:

27 passed, 0 failed out of 27 tests

Test Results [required]

tests\test_basic.py . [100%]
============ 1 passed, 100 deselected in 0.90s =============

paste output here

Screenshots (if UI change)

Before After
screenshot screenshot

Self-Review Checklist [required]

  • [1 ] I have read CONTRIBUTING.md and followed all guidelines
  • [ .] My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • [. ] I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • [ .] I have not introduced any print() or console.log() debug statements
  • [ .] Every new function I wrote has a docstring
  • [ .] I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

None

Copilot AI lite review requested due to automatic review settings September 19, 2026 05:56
@vercel

vercel Bot commented Sep 19, 2026

Copy link
Copy Markdown

@jerry-kay19 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Thank you for submitting your first pull request to DevPath.

Before review:

  • Complete the PR template fully
  • Ensure all tests pass
  • Link your PR to an issue
  • Keep changes scoped to the issue

A maintainer will review your contribution soon.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

A moderate input-handling regression and unresolved lint issues remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 2 Low severity

Open (3)
What changed in this PR

This PR fixes duplicate canonical skill entries after alias resolution and adds regression coverage.

Changes:

  • Deduplicates normalized skill aliases while preserving order.
  • Adds a regression test for duplicate aliases.
File Review findings
tests/​test_basic.py Line 1343: Nit (2 votes)—fix the docstring’s grammar and spacing. Nit (1 vote)—shorten or wrap it to meet the 88-character flake8 limit.
src/​utils/​recommender.py Line 150: Moderate (3 votes)—blank-only input can return None and cause TypeError; always return the deduplicated list. Line 147: Nit (3 votes)—remove trailing whitespace causing W291.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/utils/recommender.py Outdated
Comment on lines +150 to +151
if duplicates := [SKILL_SYNONYMS.get(token, token) for token in tokens]:
return list(dict.fromkeys(duplicates)) # deduplicate while preserving order
Comment thread src/utils/recommender.py Outdated
tokens = [
s.strip().lower()
for s in skills_string.split(",")
for s in skills_string.split(",")
Comment thread tests/test_basic.py
assert any("Data" in title or "Pipeline" in title for title in titles)

def test_parse_skill_entries_deduplicates_synonyms():
"""Verify parse_skill_entries and also removes duplicate canonical tokens after alias resolution."""
@komalharshita
komalharshita merged commit c15faac into komalharshita:main Sep 19, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants