Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Replace unwrap #183

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/iceberg/src/spec/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ mod _const_schema {
])),
)),
];
let schema = Schema::builder().with_fields(fields).build().unwrap();
let schema = Schema::builder().with_fields(fields).build()?;
schema_to_avro_schema("manifest", &schema)
}

Expand Down
4 changes: 2 additions & 2 deletions crates/iceberg/src/spec/manifest_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ impl ManifestListWriter {
pub async fn close(self) -> Result<()> {
let data = self.avro_writer.into_inner()?;
let mut writer = self.output_file.writer().await?;
writer.write_all(&data).await.unwrap();
writer.close().await.unwrap();
writer.write_all(&data).await?;
writer.close().await?;
Ok(())
}
}
Expand Down
16 changes: 8 additions & 8 deletions crates/iceberg/src/spec/table_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ pub(super) mod _serde {
schema: v
.schemas
.get(&v.current_schema_id)
.unwrap()
.expect("current_schema_id not found in schemas")
.as_ref()
.clone()
.into(),
Expand Down Expand Up @@ -867,12 +867,12 @@ mod tests {
{
"spec-id": 1,
"fields": [
{
"source-id": 4,
"field-id": 1000,
"name": "ts_day",
{
"source-id": 4,
"field-id": 1000,
"name": "ts_day",
"transform": "day"
}
}
]
}
],
Expand All @@ -882,8 +882,8 @@ mod tests {
"commit.retry.num-retries": "1"
},
"metadata-log": [
{
"metadata-file": "s3://bucket/.../v1.json",
{
"metadata-file": "s3://bucket/.../v1.json",
"timestamp-ms": 1515100
}
],
Expand Down
2 changes: 1 addition & 1 deletion crates/iceberg/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl<'a> ReplaceSortOrderAction<'a> {
.table
.metadata()
.default_sort_order()
.unwrap()
.expect("default sort order impossible to be None")
.order_id,
},
];
Expand Down
Loading