Skip to content

Commit 2d27ce4

Browse files
authored
chore: fix clippy::large_enum_variant for DataFusionError (#15861)
1 parent 2d80194 commit 2d27ce4

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

datafusion/common/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub enum DataFusionError {
5959
ParquetError(ParquetError),
6060
/// Error when reading Avro data.
6161
#[cfg(feature = "avro")]
62-
AvroError(AvroError),
62+
AvroError(Box<AvroError>),
6363
/// Error when reading / writing to / from an object_store (e.g. S3 or LocalFile)
6464
#[cfg(feature = "object_store")]
6565
ObjectStore(object_store::Error),
@@ -311,7 +311,7 @@ impl From<ParquetError> for DataFusionError {
311311
#[cfg(feature = "avro")]
312312
impl From<AvroError> for DataFusionError {
313313
fn from(e: AvroError) -> Self {
314-
DataFusionError::AvroError(e)
314+
DataFusionError::AvroError(Box::new(e))
315315
}
316316
}
317317

datafusion/datasource-avro/src/avro_to_arrow/schema.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use apache_avro::types::Value;
2222
use apache_avro::Schema as AvroSchema;
2323
use arrow::datatypes::{DataType, IntervalUnit, Schema, TimeUnit, UnionMode};
2424
use arrow::datatypes::{Field, UnionFields};
25-
use datafusion_common::error::{DataFusionError, Result};
25+
use datafusion_common::error::Result;
2626
use std::collections::HashMap;
2727
use std::sync::Arc;
2828

@@ -107,9 +107,7 @@ fn schema_to_field_with_props(
107107
.data_type()
108108
.clone()
109109
} else {
110-
return Err(DataFusionError::AvroError(
111-
apache_avro::Error::GetUnionDuplicate,
112-
));
110+
return Err(apache_avro::Error::GetUnionDuplicate.into());
113111
}
114112
} else {
115113
let fields = sub_schemas

0 commit comments

Comments
 (0)