Skip to content

Commit

Permalink
assertions on table version being accessed
Browse files Browse the repository at this point in the history
  • Loading branch information
microcassidy committed Jul 21, 2023
1 parent ef59dc5 commit 8f54469
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rust/tests/dat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn deltaeq(ctx: &SessionContext, delta_ctx_name: &str, expected: DataFrame
false
}
}
#[derive(Deserialize)]
#[derive(Deserialize, Debug)]
#[allow(dead_code)]
struct TableVersionMetadata {
version: i64,
Expand Down Expand Up @@ -48,12 +48,16 @@ async fn $test_name() -> TestResult {
.join(Path::new(&vstring))
.join(Path::new("table_content"));
if !expected_path.exists(){
dbg!("bang");
continue;
}
let expected_metadata_path = expected_path_root.join(Path::new(&vstring)).join(Path::new("table_version_metadata.json"));
let expected_metadata_rdr = std::fs::File::open(expected_metadata_path.to_str().unwrap())?;

let expected_metadata: TableVersionMetadata = serde_json::from_reader(expected_metadata_rdr)?;
let expected = ctx.read_parquet(expected_path.to_str().unwrap(), ParquetReadOptions::default()).await?;
let mut actual = open_table(&actual_path.to_str().unwrap()).await?;
actual.load_version(version).await?;
assert!(expected_metadata.version == actual.version());
ctx.register_table("actual", Arc::new(actual))?;
assert!(deltaeq(&ctx, "actual", expected).await);
}
Expand Down

0 comments on commit 8f54469

Please sign in to comment.