Skip to content

Commit f98b77c

Browse files
committed
make the proto feature actually protbuf specific
1 parent 9786a20 commit f98b77c

File tree

8 files changed

+17
-9
lines changed

8 files changed

+17
-9
lines changed

python/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pyo3 = { workspace = true }
2222
raphtory = { workspace = true, features = [
2323
"python",
2424
"vectors",
25-
"proto",
2625
] }
2726
raphtory-graphql = { workspace = true, features = [
2827
"python",
@@ -31,6 +30,7 @@ raphtory-graphql = { workspace = true, features = [
3130
[features]
3231
extension-module = ["pyo3/extension-module"]
3332
search = ["raphtory/search", "raphtory-graphql/search"]
33+
proto = ["raphtory/proto"]
3434

3535
[build-dependencies]
3636
pyo3-build-config = { workspace = true }

raphtory-benchmark/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ edition = "2021"
99
criterion = { workspace = true }
1010
raphtory = { workspace = true, features = [
1111
"io",
12-
"proto",
1312
"vectors",
1413
] }
1514
raphtory-api = { workspace = true }
@@ -61,10 +60,12 @@ harness = false
6160
[[bench]]
6261
name = "proto_encode"
6362
harness = false
63+
required-features = ["proto"]
6464

6565
[[bench]]
6666
name = "proto_decode"
6767
harness = false
68+
required-features = ["proto"]
6869

6970
[[bench]]
7071
name = "search_bench"
@@ -82,3 +83,4 @@ required-features = ["search"]
8283

8384
[features]
8485
search = ["raphtory/search"]
86+
proto = ["raphtory/proto"]

raphtory/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ io = [
123123
"dep:tokio",
124124
"dep:parquet",
125125
"dep:tempfile",
126+
"dep:zip",
126127
"kdam",
127128
]
128129

@@ -168,7 +169,6 @@ arrow = [
168169
proto = [
169170
"dep:prost",
170171
"dep:prost-types",
171-
"dep:zip",
172172
"dep:prost-build",
173173
"dep:memmap2",
174174
"arrow",

raphtory/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ pub enum GraphError {
255255
#[error("The path {0} does not contain a vector DB")]
256256
VectorDbDoesntExist(String),
257257

258-
#[cfg(feature = "proto")]
258+
#[cfg(feature = "io")]
259259
#[error("zip operation failed")]
260260
ZipError {
261261
#[from]
@@ -327,7 +327,7 @@ pub enum GraphError {
327327
#[error("Protobuf decode error{0}")]
328328
EncodeError(#[from] prost::EncodeError),
329329

330-
#[cfg(feature = "proto")]
330+
#[cfg(feature = "io")]
331331
#[error("Cannot write graph into non empty folder {0}")]
332332
NonEmptyGraphFolder(PathBuf),
333333

raphtory/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub mod io;
106106
pub mod api;
107107
pub mod core;
108108
pub mod errors;
109-
#[cfg(feature = "proto")]
109+
#[cfg(feature = "io")]
110110
pub mod serialise;
111111
pub mod storage;
112112

@@ -149,7 +149,7 @@ pub mod prelude {
149149
},
150150
};
151151

152-
#[cfg(feature = "proto")]
152+
#[cfg(all(feature = "io", feature = "arrow"))]
153153
pub use crate::serialise::{
154154
parquet::{ParquetDecoder, ParquetEncoder},
155155
StableDecode, StableEncode,

raphtory/src/serialise/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
mod graph_folder;
22
pub mod metadata;
3+
#[cfg(feature = "arrow")]
34
pub(crate) mod parquet;
5+
6+
#[cfg(feature = "proto")]
47
pub mod proto;
58
mod serialise;
69

710
pub use graph_folder::{GraphFolder, GRAPH_PATH, INDEX_PATH, META_PATH, VECTORS_PATH};
8-
pub use proto::proto_generated::Graph as ProtoGraph;
911
pub use serialise::{StableDecode, StableEncode};
12+
13+
#[cfg(feature = "proto")]
14+
pub use proto::proto_generated::Graph as ProtoGraph;

raphtory/src/serialise/parquet/model.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'a> Serialize for ParquetProp<'a> {
5555
}
5656
Prop::Decimal(dec) => serializer.serialize_str(&dec.to_string()),
5757
Prop::Array(_) => {
58-
todo!("Serializer not implemented for Array (TODO: ")
58+
todo!("Serializer not implemented for Array (TODO: #2377)")
5959
}
6060
}
6161
}

raphtory/tests/serialise_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ mod serialise_test {
237237
}
238238

239239
#[test]
240+
#[ignore = "TODO: #2377"]
240241
fn test_all_the_metadata_on_edge() {
241242
let mut props = vec![];
242243
write_props_to_vec(&mut props);

0 commit comments

Comments
 (0)