Skip to content

Commit

Permalink
Merge branch 'main' into fix/use_require_files
Browse files Browse the repository at this point in the history
  • Loading branch information
rtyler authored Sep 12, 2024
2 parents 1cc7d90 + 507b50e commit 8b531e7
Show file tree
Hide file tree
Showing 16 changed files with 372 additions and 129 deletions.
2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ tracing = { workspace = true }
rand = "0.8"
z85 = "3.0.5"
maplit = "1"
sqlparser = { version = "0.50" }
sqlparser = { version = "0.51" }

# Unity
reqwest = { version = "0.11.18", default-features = false, features = [
Expand Down
6 changes: 6 additions & 0 deletions crates/core/src/operations/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ impl CommitProperties {
self
}

/// Specify maximum number of times to retry the transaction before failing to commit
pub fn with_max_retries(mut self, max_retries: usize) -> Self {
self.max_retries = max_retries;
self
}

/// Specify if it should create a checkpoint when the commit interval condition is met
pub fn with_create_checkpoint(mut self, create_checkpoint: bool) -> Self {
self.create_checkpoint = create_checkpoint;
Expand Down
1 change: 1 addition & 0 deletions python/deltalake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .table import (
ColumnProperties as ColumnProperties,
)
from .table import CommitProperties as CommitProperties
from .table import DeltaTable as DeltaTable
from .table import Metadata as Metadata
from .table import PostCommitHookProperties as PostCommitHookProperties
Expand Down
35 changes: 20 additions & 15 deletions python/deltalake/_internal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ from typing import Any, Dict, List, Literal, Mapping, Optional, Tuple, Union
import pyarrow
import pyarrow.fs as fs

from deltalake.writer import AddAction, PostCommitHookProperties, WriterProperties
from deltalake.writer import (
AddAction,
CommitProperties,
PostCommitHookProperties,
WriterProperties,
)

__version__: str

Expand Down Expand Up @@ -58,7 +63,7 @@ class RawDeltaTable:
dry_run: bool,
retention_hours: Optional[int],
enforce_retention_duration: bool,
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> List[str]: ...
def compact_optimize(
Expand All @@ -68,7 +73,7 @@ class RawDeltaTable:
max_concurrent_tasks: Optional[int],
min_commit_interval: Optional[int],
writer_properties: Optional[WriterProperties],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> str: ...
def z_order_optimize(
Expand All @@ -80,40 +85,40 @@ class RawDeltaTable:
max_spill_size: Optional[int],
min_commit_interval: Optional[int],
writer_properties: Optional[WriterProperties],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> str: ...
def add_columns(
self,
fields: List[Field],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> None: ...
def add_constraints(
self,
constraints: Dict[str, str],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> None: ...
def drop_constraints(
self,
name: str,
raise_if_not_exists: bool,
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> None: ...
def set_table_properties(
self,
properties: Dict[str, str],
raise_if_not_exists: bool,
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
) -> None: ...
def restore(
self,
target: Optional[Any],
ignore_missing_files: bool,
protocol_downgrade_allowed: bool,
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
) -> str: ...
def history(self, limit: Optional[int]) -> List[str]: ...
def update_incremental(self) -> None: ...
Expand All @@ -126,13 +131,13 @@ class RawDeltaTable:
self,
predicate: Optional[str],
writer_properties: Optional[WriterProperties],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> str: ...
def repair(
self,
dry_run: bool,
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> str: ...
def update(
Expand All @@ -141,7 +146,7 @@ class RawDeltaTable:
predicate: Optional[str],
writer_properties: Optional[WriterProperties],
safe_cast: bool,
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> str: ...
def create_merge_builder(
Expand All @@ -151,7 +156,7 @@ class RawDeltaTable:
source_alias: Optional[str],
target_alias: Optional[str],
writer_properties: Optional[WriterProperties],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
safe_cast: bool,
) -> PyMergeBuilder: ...
Expand All @@ -166,7 +171,7 @@ class RawDeltaTable:
partition_by: List[str],
schema: pyarrow.Schema,
partitions_filters: Optional[FilterType],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> None: ...
def cleanup_metadata(self) -> None: ...
Expand Down Expand Up @@ -207,7 +212,7 @@ def write_to_deltalake(
configuration: Optional[Mapping[str, Optional[str]]],
storage_options: Optional[Dict[str, str]],
writer_properties: Optional[WriterProperties],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
) -> None: ...
def convert_to_deltalake(
Expand Down
Loading

0 comments on commit 8b531e7

Please sign in to comment.