Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion merino/providers/suggest/adm/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def normalize_query(self, query: str) -> str:

def _fetch_engagement_metrics(self, suggestion: PyAmpResult) -> EngagementMetrics:
"""Fetch engagement metrics for an AMP suggestion."""
advertiser = suggestion.advertiser
advertiser = suggestion.advertiser.lower()
engaged, attempted = 1, 1
if self.engagement_data and (metrics := self.engagement_data.amp.get(advertiser)):
attempted = int(metrics.get("impressions", attempted))
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/providers/suggest/adm/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ def fixture_engagement_data() -> EngagementData:
"clicks": 5,
},
"Example.org": {
"advertiser": "Example.org",
"advertiser": "example.org",
"impressions": 10001,
"clicks": 10000,
},
"LowEngagement": {
"advertiser": "LowEngagement",
"advertiser": "lowengagement",
"impressions": 9999,
"clicks": 5,
},
Expand Down Expand Up @@ -329,7 +329,7 @@ def fixture_adm_with_thompson_single_candidate_below_threshold(
)
provider.engagement_data = EngagementData(
amp={
"Example.org": {"click": 10, "impression": 100},
"example.org": {"click": 10, "impression": 100},
},
amp_aggregated={},
)
Expand Down
Loading