Skip to content

Commit d67a390

Browse files
authored
Merge pull request #554 from AmbireTech/remove_alexa_rank
removed alexa_rank
2 parents 1058410 + 586d27e commit d67a390

File tree

4 files changed

+2
-15
lines changed

4 files changed

+2
-15
lines changed

primitives/src/targeting/eval_test.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ mod dsl_test {
136136
input.ad_slot = Some(input::AdSlot {
137137
categories: vec!["Bitcoin".to_string(), "Ethereum".to_string()],
138138
hostname: Default::default(),
139-
alexa_rank: Some(0.0),
140139
});
141140

142141
let mut output = Output {
@@ -163,7 +162,6 @@ mod dsl_test {
163162
input.ad_slot = Some(input::AdSlot {
164163
categories: vec!["Advertisement".to_string(), "Programming".to_string()],
165164
hostname: Default::default(),
166-
alexa_rank: Some(0.0),
167165
});
168166

169167
let result = rules.eval(&input, &mut output).expect("Should eval rules");

primitives/src/targeting/input.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,12 @@ impl GetField for Global {
176176
}
177177
}
178178

179-
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
179+
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
180180
#[serde(rename_all = "camelCase")]
181181
/// AdSlot scope, accessible on Supermarket and AdView
182182
pub struct AdSlot {
183183
pub categories: Vec<String>,
184184
pub hostname: String,
185-
pub alexa_rank: Option<f64>,
186185
}
187186

188187
impl GetField for AdSlot {
@@ -198,10 +197,6 @@ impl GetField for AdSlot {
198197
.collect(),
199198
)),
200199
field::AdSlot::Hostname => Some(Value::String(self.hostname.clone())),
201-
field::AdSlot::AlexaRank => self
202-
.alexa_rank
203-
.and_then(serde_json::Number::from_f64)
204-
.map(Value::Number),
205200
}
206201
}
207202
}
@@ -413,7 +408,6 @@ mod test {
413408
// adSlot scope, accessible on Supermarket and AdView
414409
"adSlot.categories": ["IAB3", "IAB13-7", "IAB5"],
415410
"adSlot.hostname": "adex.network",
416-
"adSlot.alexaRank": 2.0,
417411
});
418412

419413
let actual_date = Utc.ymd(2020, 6, 6).and_hms(12, 0, 0);
@@ -466,7 +460,6 @@ mod test {
466460
ad_slot: Some(AdSlot {
467461
categories: vec!["IAB3".into(), "IAB13-7".into(), "IAB5".into()],
468462
hostname: "adex.network".into(),
469-
alexa_rank: Some(2.0),
470463
}),
471464
};
472465

primitives/src/targeting/input/field.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::str::FromStr;
44

55
use crate::targeting::Error;
66

7-
pub const FIELDS: [Field; 24] = [
7+
pub const FIELDS: [Field; 23] = [
88
// AdView scope, accessible only on the AdView
99
Field::AdView(AdView::SecondsSinceCampaignImpression),
1010
Field::AdView(AdView::HasCustomPreferences),
@@ -35,7 +35,6 @@ pub const FIELDS: [Field; 24] = [
3535
// AdSlot scope, accessible on Supermarket and AdView
3636
Field::AdSlot(AdSlot::Categories),
3737
Field::AdSlot(AdSlot::Hostname),
38-
Field::AdSlot(AdSlot::AlexaRank),
3938
];
4039

4140
#[derive(
@@ -174,7 +173,6 @@ impl From<Balances> for String {
174173
pub enum AdSlot {
175174
Categories,
176175
Hostname,
177-
AlexaRank,
178176
}
179177

180178
impl TryFrom<String> for AdSlot {

sentry/src/routes/units_for_slot.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ where
8080

8181
// TODO: remove once we know how/where we will be fetching the rest of the information!
8282
let accepted_referrers: Vec<Url> = vec!["TODO".parse().unwrap()];
83-
let alexa_rank = Some(1.0_f64);
8483
let categories: Vec<String> = vec!["TODO".into()];
8584

8685
let units = match app
@@ -189,7 +188,6 @@ where
189188
let targeting_input_ad_slot = Some(input::AdSlot {
190189
categories: categories.clone(),
191190
hostname,
192-
alexa_rank,
193191
});
194192

195193
let mut targeting_input_base = Input {

0 commit comments

Comments
 (0)