Skip to content

Commit da5e16c

Browse files
committed
style: anyhow::Result
1 parent aa0befa commit da5e16c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/event/format/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use std::{
2424
sync::Arc,
2525
};
2626

27-
use anyhow::{anyhow, Error as AnyError};
27+
use anyhow::anyhow;
2828
use arrow_array::RecordBatch;
2929
use arrow_schema::{DataType, Field, Schema, TimeUnit};
3030
use chrono::{DateTime, Utc};
@@ -119,14 +119,14 @@ pub trait EventFormat: Sized {
119119
schema_version: SchemaVersion,
120120
) -> anyhow::Result<(EventSchema, IsFirstEvent)>;
121121

122-
fn decode(data: Self::Data, schema: Arc<Schema>) -> Result<RecordBatch, AnyError>;
122+
fn decode(data: Self::Data, schema: Arc<Schema>) -> anyhow::Result<RecordBatch>;
123123

124124
/// Updates inferred schema with `p_timestamp` field and ensures it adheres to expectations
125125
fn prepare_and_validate_schema(
126126
mut schema: EventSchema,
127127
storage_schema: &HashMap<String, Arc<Field>>,
128128
static_schema_flag: bool,
129-
) -> Result<EventSchema, AnyError> {
129+
) -> anyhow::Result<EventSchema> {
130130
if get_field(&schema, DEFAULT_TIMESTAMP_KEY).is_some() {
131131
return Err(anyhow!("field {DEFAULT_TIMESTAMP_KEY} is a reserved field",));
132132
}
@@ -160,7 +160,7 @@ pub trait EventFormat: Sized {
160160
schema: &EventSchema,
161161
time_partition: Option<&String>,
162162
schema_version: SchemaVersion,
163-
) -> Result<RecordBatch, AnyError> {
163+
) -> anyhow::Result<RecordBatch> {
164164
// prepare the record batch and new fields to be added
165165
let mut new_schema = Arc::new(Schema::new(schema.clone()));
166166
new_schema =
@@ -176,7 +176,7 @@ pub trait EventFormat: Sized {
176176
Ok(rb)
177177
}
178178

179-
fn into_event(self, stream: &Stream) -> Result<Event, AnyError>;
179+
fn into_event(self, stream: &Stream) -> anyhow::Result<Event>;
180180
}
181181

182182
pub fn get_existing_field_names(

0 commit comments

Comments
 (0)