Skip to content

Commit

Permalink
fix: Remove a unwrap in grpc arrow adapter (#2068)
Browse files Browse the repository at this point in the history
  • Loading branch information
chubei authored Sep 21, 2023
1 parent 67f1b8a commit 556ce6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dozer-ingestion/src/connectors/grpc/adapter/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fn map_record_batch(
) -> Result<Vec<Record>, ConnectorError> {
let mut buf = Bytes::from(req.records).reader();
// read stream back
let mut reader = StreamReader::try_new(&mut buf, None).unwrap();
let mut reader = StreamReader::try_new(&mut buf, None)?;
let mut records = Vec::new();
while let Some(Ok(batch)) = reader.next() {
let b_recs = map_record_batch_to_dozer_records(batch, schema)
Expand Down
3 changes: 3 additions & 0 deletions dozer-ingestion/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(clippy::enum_variant_names)]

use deltalake::arrow::error::ArrowError;
use dozer_log::errors::{ReaderBuilderError, ReaderError};
use dozer_types::errors::internal::BoxedError;
use dozer_types::errors::types::{DeserializationError, SerializationError, TypeError};
Expand Down Expand Up @@ -52,6 +53,8 @@ pub enum ConnectorError {

#[error("Unsupported grpc adapter: {0} {1}")]
UnsupportedGrpcAdapter(String, String),
#[error("Arrow error: {0}")]
Arrow(#[from] ArrowError),

#[error("Table not found: {0}")]
TableNotFound(String),
Expand Down

0 comments on commit 556ce6b

Please sign in to comment.