@@ -66,7 +66,7 @@ pub async fn fetch_parquet_file_paths(
6666) -> Result < HashMap < RelativePathBuf , Vec < File > > , ObjectStorageError > {
6767 let glob_storage = PARSEABLE . storage . get_object_store ( ) ;
6868
69- let object_store_format = glob_storage. get_object_store_format ( stream) . await . unwrap ( ) ;
69+ let object_store_format = glob_storage. get_object_store_format ( stream) . await ? ;
7070
7171 let time_partition = object_store_format. time_partition ;
7272
@@ -103,8 +103,7 @@ pub async fn fetch_parquet_file_paths(
103103 . map ( |item| item. manifest_path )
104104 . collect ( ) ,
105105 )
106- . await
107- . unwrap ( ) ;
106+ . await ?;
108107
109108 let mut parquet_files: HashMap < RelativePathBuf , Vec < File > > = HashMap :: new ( ) ;
110109
@@ -137,24 +136,24 @@ pub async fn fetch_parquet_file_paths(
137136async fn collect_manifest_files (
138137 storage : Arc < dyn ObjectStorage > ,
139138 manifest_urls : Vec < String > ,
140- ) -> Result < Vec < Manifest > , object_store :: Error > {
139+ ) -> Result < Vec < Manifest > , ObjectStorageError > {
141140 let mut tasks = Vec :: new ( ) ;
142141 manifest_urls. into_iter ( ) . for_each ( |path| {
143- let path = RelativePathBuf :: from_path ( PathBuf :: from ( path) ) . unwrap ( ) ;
142+ let path = RelativePathBuf :: from_path ( PathBuf :: from ( path) ) . expect ( "Invalid path" ) ;
144143 let storage = Arc :: clone ( & storage) ;
145144 tasks. push ( tokio:: task:: spawn ( async move {
146- storage. get_object ( & path) . await . unwrap ( )
145+ storage. get_object ( & path) . await
147146 } ) ) ;
148147 } ) ;
149148
150149 let mut op = Vec :: new ( ) ;
151150 for task in tasks {
152- let file = task. await . unwrap ( ) ;
151+ let file = task. await ?? ;
153152 op. push ( file) ;
154153 }
155154
156155 Ok ( op
157156 . into_iter ( )
158- . map ( |res| serde_json:: from_slice ( & res) . unwrap ( ) )
157+ . map ( |res| serde_json:: from_slice ( & res) . expect ( "Data is invalid for Manifest" ) )
159158 . collect ( ) )
160159}
0 commit comments