File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
merino/providers/suggest/adm
tests/unit/providers/suggest/adm Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ def normalize_query(self, query: str) -> str:
210210
211211 def _fetch_engagement_metrics (self , suggestion : PyAmpResult ) -> EngagementMetrics :
212212 """Fetch engagement metrics for an AMP suggestion."""
213- advertiser = suggestion .advertiser
213+ advertiser = suggestion .advertiser . lower ()
214214 engaged , attempted = 1 , 1
215215 if self .engagement_data and (metrics := self .engagement_data .amp .get (advertiser )):
216216 attempted = int (metrics .get ("impressions" , attempted ))
Original file line number Diff line number Diff line change @@ -216,12 +216,12 @@ def fixture_engagement_data() -> EngagementData:
216216 "clicks" : 5 ,
217217 },
218218 "Example.org" : {
219- "advertiser" : "Example .org" ,
219+ "advertiser" : "example .org" ,
220220 "impressions" : 10001 ,
221221 "clicks" : 10000 ,
222222 },
223223 "LowEngagement" : {
224- "advertiser" : "LowEngagement " ,
224+ "advertiser" : "lowengagement " ,
225225 "impressions" : 9999 ,
226226 "clicks" : 5 ,
227227 },
@@ -329,7 +329,7 @@ def fixture_adm_with_thompson_single_candidate_below_threshold(
329329 )
330330 provider .engagement_data = EngagementData (
331331 amp = {
332- "Example .org" : {"click" : 10 , "impression" : 100 },
332+ "example .org" : {"click" : 10 , "impression" : 100 },
333333 },
334334 amp_aggregated = {},
335335 )
You can’t perform that action at this time.
0 commit comments