Skip to content

Commit 08150e6

Browse files
JanKaulJan Kaul
authored andcommitted
Merge pull request JanKaul#223 from JanKaul/more-context-for-unimplemented
provide more context for unimplemented macro
2 parents 2e2cf62 + 144639a commit 08150e6

File tree

7 files changed

+41
-11
lines changed

7 files changed

+41
-11
lines changed

.github/workflows/rust.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ jobs:
1313
test:
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Free disk space
17+
uses: jlumbroso/free-disk-space@main
18+
with:
19+
tool-cache: false
20+
android: true
21+
dotnet: true
22+
haskell: true
23+
large-packages: false
24+
docker-images: false
25+
swap-storage: false
1626
- uses: actions/checkout@v3
1727
- name: Build
1828
run: cargo build --verbose

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ test-iceberg-rust:
77
cargo test -p iceberg-rust --lib
88

99
test-datafusion_iceberg:
10-
cargo test -p datafusion_iceberg --tests -j 2 && cargo clean -p datafusion_iceberg
10+
cargo test -p datafusion_iceberg --tests -j 2
1111

1212
test-rest-catalog:
13-
cargo test -p iceberg-rest-catalog --lib && cargo clean -p iceberg-rest-catalog
13+
cargo test -p iceberg-rest-catalog --lib
1414

1515
test-file-catalog:
16-
cargo test -p iceberg-file-catalog --lib && cargo clean -p iceberg-file-catalog
16+
cargo test -p iceberg-file-catalog --lib
1717

1818
test-sql-catalog:
19-
cargo test -p iceberg-sql-catalog --lib && cargo clean -p iceberg-sql-catalog
19+
cargo test -p iceberg-sql-catalog --lib
2020
clippy:
2121
cargo clippy --all-targets --all-features -- -D warnings
2222
fmt:

catalogs/iceberg-file-catalog/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ impl Catalog for FileCatalog {
506506
_identifier: Identifier,
507507
_metadata_location: &str,
508508
) -> Result<Table, IcebergError> {
509-
unimplemented!()
509+
unimplemented!("Register table for file catalog")
510510
}
511511
}
512512

iceberg-rust-spec/src/spec/table_metadata.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,15 @@ impl From<FormatVersion> for u8 {
892892
}
893893
}
894894

895+
impl From<FormatVersion> for i32 {
896+
fn from(value: FormatVersion) -> Self {
897+
match value {
898+
FormatVersion::V1 => 1,
899+
FormatVersion::V2 => 2,
900+
}
901+
}
902+
}
903+
895904
#[cfg(test)]
896905
mod tests {
897906

iceberg-rust-spec/src/spec/values.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ impl Value {
670670
precision: 38,
671671
scale: dec.scale(),
672672
}),
673-
_ => unimplemented!(),
673+
_ => unimplemented!("Datatype for value"),
674674
}
675675
}
676676

@@ -698,7 +698,7 @@ impl Value {
698698
Value::String(any) => Box::new(any),
699699
Value::UUID(any) => Box::new(any),
700700
Value::Decimal(any) => Box::new(any),
701-
_ => unimplemented!(),
701+
_ => unimplemented!("Value conversion to any"),
702702
}
703703
}
704704

iceberg-rust-spec/src/spec/view_metadata.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,14 @@ impl From<FormatVersion> for u8 {
301301
}
302302
}
303303

304+
impl From<FormatVersion> for i32 {
305+
fn from(value: FormatVersion) -> Self {
306+
match value {
307+
FormatVersion::V1 => 1,
308+
}
309+
}
310+
}
311+
304312
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Default, Builder, Getters)]
305313
#[serde(rename_all = "kebab-case")]
306314
/// Fields for the version 2 of the view metadata.

iceberg-rust/src/catalog/commit.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,10 @@ pub fn apply_table_updates(
420420
for update in updates {
421421
match update {
422422
TableUpdate::UpgradeFormatVersion { format_version } => {
423-
if u8::from(metadata.format_version) == format_version as u8 {
423+
if i32::from(metadata.format_version) == format_version {
424424
return Ok(());
425425
}
426-
unimplemented!();
426+
unimplemented!("Table format upgrade");
427427
}
428428
TableUpdate::AssignUuid { uuid } => {
429429
metadata.table_uuid = Uuid::parse_str(&uuid)?;
@@ -519,8 +519,11 @@ pub fn apply_view_updates<T: Materialization + 'static>(
519519
) -> Result<(), Error> {
520520
for update in updates {
521521
match update {
522-
ViewUpdate::UpgradeFormatVersion { format_version: _ } => {
523-
unimplemented!();
522+
ViewUpdate::UpgradeFormatVersion { format_version } => {
523+
if i32::from(metadata.format_version.clone()) == format_version {
524+
return Ok(());
525+
}
526+
unimplemented!("Upgrade of format version");
524527
}
525528
ViewUpdate::AssignUuid { uuid } => {
526529
metadata.view_uuid = Uuid::parse_str(&uuid)?;

0 commit comments

Comments
 (0)