Skip to content

Commit

Permalink
Merge branch 'main' into docs/writer_properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco authored Jan 2, 2024
2 parents cb8229e + 7add491 commit 33efa70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions crates/deltalake-core/tests/command_restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use arrow_schema::{DataType as ArrowDataType, Field};
use chrono::{DateTime, NaiveDateTime, TimeZone, Utc};
use deltalake_core::kernel::{DataType, PrimitiveType, StructField};
use deltalake_core::protocol::SaveMode;
use deltalake_core::storage::commit_uri_from_version;
use deltalake_core::{DeltaOps, DeltaTable};
use rand::Rng;
use std::error::Error;
Expand Down Expand Up @@ -117,9 +118,15 @@ async fn test_restore_by_version() -> Result<(), Box<dyn Error>> {
#[tokio::test]
async fn test_restore_by_datetime() -> Result<(), Box<dyn Error>> {
let context = setup_test().await?;
let mut table = context.table;
let history = table.history(Some(10)).await?;
let timestamp = history.get(1).unwrap().timestamp.unwrap();
let table = context.table;
let version = 1;

// The way we obtain a timestamp for a version will have to change when/if we start using CommitInfo for timestamps
let meta = table
.object_store()
.head(&commit_uri_from_version(version))
.await?;
let timestamp = meta.last_modified.timestamp_millis();
let naive = NaiveDateTime::from_timestamp_millis(timestamp).unwrap();
let datetime: DateTime<Utc> = Utc.from_utc_datetime(&naive);

Expand Down
2 changes: 1 addition & 1 deletion python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deltalake-python"
version = "0.14.0"
version = "0.15.0"
authors = ["Qingping Hou <[email protected]>", "Will Jones <[email protected]>"]
homepage = "https://github.com/delta-io/delta-rs"
license = "Apache-2.0"
Expand Down

0 comments on commit 33efa70

Please sign in to comment.