Skip to content

Commit a1d9f7f

Browse files
committed
interchange,testdrive: unfork serde-protobuf
We forked serde-protobuf library to add one method to improve an error message. Empirically we have not been keeping up with maintenance of our fork, so it's time to ditch the fork. This commit swaps our fork for the latest official serde-protobuf release. I left a TODO to restore the error message improvement if the patch [0] from our fork is accepted upstream. Notably, this commit removes the last usage of failure from our codebase. [0]: dflemstr/serde-protobuf#9
1 parent 35c004b commit a1d9f7f

File tree

5 files changed

+17
-37
lines changed

5 files changed

+17
-37
lines changed

Cargo.lock

Lines changed: 6 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deny.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ allow-git = [
4646
"https://github.com/MaterializeInc/rust-postgres.git",
4747
"https://github.com/MaterializeInc/rust-postgres-array.git",
4848
"https://github.com/MaterializeInc/rust-prometheus.git",
49-
"https://github.com/MaterializeInc/serde-protobuf.git",
5049
"https://github.com/TimelyDataflow/timely-dataflow",
5150
"https://github.com/TimelyDataflow/differential-dataflow.git",
5251
"https://github.com/fede1024/rust-rdkafka.git",

src/interchange/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ore = { path = "../ore" }
3131
protobuf = "2.23.0"
3232
repr = { path = "../repr" }
3333
serde = { version = "1.0.127", features = ["derive"] }
34-
serde-protobuf = { git = "https://github.com/MaterializeInc/serde-protobuf.git", branch = "add-iter-messages" }
34+
serde-protobuf = "0.8.2"
3535
serde-value = "0.7.0"
3636
serde_json = "1.0.66"
3737
sha2 = "0.9.5"

src/interchange/src/protobuf.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use serde_protobuf::descriptor::{
2222
use serde_protobuf::value::Value as ProtoValue;
2323
use serde_value::Value as SerdeValue;
2424

25+
use ore::str::StrExt;
2526
use repr::adt::numeric::Numeric;
2627
use repr::{ColumnType, Datum, DatumList, RelationDesc, RelationType, Row, ScalarType};
2728

@@ -133,14 +134,15 @@ pub fn decode_descriptors(descriptors: &[u8]) -> Result<Descriptors> {
133134
pub fn validate_descriptors(message_name: &str, descriptors: &Descriptors) -> Result<RelationDesc> {
134135
let proto_name = proto_message_name(message_name);
135136
let message = descriptors.message_by_name(&proto_name).ok_or_else(|| {
137+
// TODO(benesch): the error message here used to include the names of
138+
// all messages in the descriptor set, but that one feature required
139+
// maintaining a fork of serde_protobuf. I sent the patch upstream [0],
140+
// and we can add the error message improvement back if that patch is
141+
// accepted.
142+
// [0]: https://github.com/dflemstr/serde-protobuf/pull/9
136143
anyhow!(
137-
"Message {:?} not found in file descriptor set: {}",
138-
proto_name,
139-
descriptors
140-
.iter_messages()
141-
.map(|m| m.name())
142-
.collect::<Vec<_>>()
143-
.join(", ")
144+
"Message {} not found in file descriptor set",
145+
proto_name.quoted()
144146
)
145147
})?;
146148
let mut seen_messages = HashSet::new();

src/testdrive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ rusoto_s3 = "0.47.0"
4040
rusoto_sqs = "0.47.0"
4141
rusoto_sts = "0.47.0"
4242
serde = "1.0.127"
43-
serde-protobuf = { git = "https://github.com/MaterializeInc/serde-protobuf.git", branch = "add-iter-messages" }
43+
serde-protobuf = "0.8.2"
4444
serde_json = "1.0.66"
4545
sql-parser = { path = "../sql-parser" }
4646
structopt = "0.3.22"

0 commit comments

Comments
 (0)