Skip to content

Handle capitalization changes in keywords #341

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

Merged
merged 2 commits into from
Apr 23, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion jobs/webcompat-kb/webcompat_kb/metric_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,17 @@ def bugs_historic_states(
if field_change.field_name == "keywords":
for keyword in field_change.added.split(", "):
if keyword:
prev.keywords.remove(keyword)
try:
prev.keywords.remove(keyword)
except ValueError:
# Occasionally keywords change case
for prev_keyword in prev.keywords:
if prev_keyword.lower() == keyword.lower():
prev.keywords.remove(prev_keyword)
logging.warning(f"Didn't find keyword {keyword} using {prev_keyword}")
break
else:
raise
for keyword in field_change.removed.split(", "):
if keyword:
prev.keywords.append(keyword)
Expand Down