Skip to content

Commit 9a381c2

Browse files
author
Zoran Cvetkov
committed
cleanup
1 parent d178175 commit 9a381c2

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

graph/src/components/store/write.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,30 +1017,29 @@ mod test {
10171017

10181018
let value = value.clone();
10191019
let key = THING_TYPE.parse_key("one").unwrap();
1020-
let vid = 0i64;
10211020
match value {
10221021
Ins(block) => EntityModification::Insert {
10231022
key,
1024-
data: Arc::new(entity! { SCHEMA => id: "one", count: block, vid: vid }),
1023+
data: Arc::new(entity! { SCHEMA => id: "one", count: block }),
10251024
block,
10261025
end: None,
10271026
},
10281027
Ovw(block) => EntityModification::Overwrite {
10291028
key,
1030-
data: Arc::new(entity! { SCHEMA => id: "one", count: block, vid: vid }),
1029+
data: Arc::new(entity! { SCHEMA => id: "one", count: block }),
10311030
block,
10321031
end: None,
10331032
},
10341033
Rem(block) => EntityModification::Remove { key, block },
10351034
InsC(block, end) => EntityModification::Insert {
10361035
key,
1037-
data: Arc::new(entity! { SCHEMA => id: "one", count: block, vid: vid }),
1036+
data: Arc::new(entity! { SCHEMA => id: "one", count: block }),
10381037
block,
10391038
end: Some(end),
10401039
},
10411040
OvwC(block, end) => EntityModification::Overwrite {
10421041
key,
1043-
data: Arc::new(entity! { SCHEMA => id: "one", count: block, vid: vid }),
1042+
data: Arc::new(entity! { SCHEMA => id: "one", count: block }),
10441043
block,
10451044
end: Some(end),
10461045
},

graph/src/data/store/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ impl Entity {
924924
self.0.insert("vid", value.into())
925925
}
926926

927-
/// Sets the VID if not set. Should be used only for tests.
927+
/// Sets the VID if it's not already set. Should be used only for tests.
928928
#[cfg(debug_assertions)]
929929
pub fn set_vid_if_empty(&mut self) {
930930
let vid = self.get("vid");
@@ -948,7 +948,7 @@ impl Entity {
948948
/// If a key only exists on one entity, the value from that entity is chosen.
949949
/// If a key is set to `Value::Null` in `update`, the key/value pair is removed.
950950
pub fn merge_remove_null_fields(&mut self, update: Entity) -> Result<(), InternError> {
951-
for (key, value) in update.into_iter() {
951+
for (key, value) in update.0.into_iter() {
952952
match value {
953953
Value::Null => self.0.remove(&key),
954954
_ => self.0.insert(&key, value)?,

store/postgres/src/relational_queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ impl EntityData {
540540
// block_range that `select *` pulls in but that we
541541
// don't care about here
542542
if key == "vid" {
543-
// VID is not in the input schema but we need it so deserialize it too
543+
// VID is not in the input schema but we need it, so deserialize it too
544544
match T::Value::from_column_value(&ColumnType::Int8, json) {
545545
Ok(value) if value.is_null() => None,
546546
Ok(value) => Some(Ok((Word::from("vid"), value))),

store/test-store/tests/chain/ethereum/manifest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ specVersion: 0.0.2
416416
msg
417417
);
418418

419-
let thing = entity! { schema => id: "datthing", vid: 1i64 };
419+
let thing = entity! { schema => id: "datthing" };
420420
test_store::insert_entities(
421421
&deployment,
422422
vec![(schema.entity_type("Thing").unwrap(), thing)],

store/test-store/tests/postgres/aggregation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub async fn insert(
8282
.map(|mut data| {
8383
let data_type = schema.entity_type("Data").unwrap();
8484
let key = data_type.key(data.id());
85-
let _ = data.set_vid_if_empty();
85+
data.set_vid_if_empty();
8686
EntityOperation::Set { data, key }
8787
})
8888
.collect();

0 commit comments

Comments
 (0)