Skip to content

Commit

Permalink
chore: Create pyo3 class for CommitProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
helanto authored and rtyler committed Sep 12, 2024
1 parent 384158c commit 507b50e
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 231 deletions.
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
49 changes: 20 additions & 29 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 @@ -57,9 +62,8 @@ 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],
max_commit_retries: Optional[int],
) -> List[str]: ...
def compact_optimize(
self,
Expand All @@ -68,9 +72,8 @@ 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],
max_commit_retries: Optional[int],
) -> str: ...
def z_order_optimize(
self,
Expand All @@ -81,46 +84,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],
max_commit_retries: Optional[int],
) -> str: ...
def add_columns(
self,
fields: List[Field],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
max_commit_retries: Optional[int],
) -> None: ...
def add_constraints(
self,
constraints: Dict[str, str],
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
max_commit_retries: Optional[int],
) -> 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],
max_commit_retries: Optional[int],
) -> None: ...
def set_table_properties(
self,
properties: Dict[str, str],
raise_if_not_exists: bool,
custom_metadata: Optional[Dict[str, str]],
max_commit_retries: Optional[int],
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]],
max_commit_retries: Optional[int],
commit_properties: Optional[CommitProperties],
) -> str: ...
def history(self, limit: Optional[int]) -> List[str]: ...
def update_incremental(self) -> None: ...
Expand All @@ -133,26 +130,23 @@ 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],
max_commit_retries: Optional[int],
) -> str: ...
def repair(
self,
dry_run: bool,
custom_metadata: Optional[Dict[str, str]],
commit_properties: Optional[CommitProperties],
post_commithook_properties: Optional[PostCommitHookProperties],
max_commit_retries: Optional[int],
) -> str: ...
def update(
self,
updates: Dict[str, str],
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],
max_commit_retries: Optional[int],
) -> str: ...
def create_merge_builder(
self,
Expand All @@ -161,10 +155,9 @@ 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,
max_commit_retries: Optional[int],
) -> PyMergeBuilder: ...
def merge_execute(self, merge_builder: PyMergeBuilder) -> str: ...
def get_active_partitions(
Expand All @@ -177,9 +170,8 @@ 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],
max_commit_retries: Optional[int],
) -> None: ...
def cleanup_metadata(self) -> None: ...
def check_can_write_timestamp_ntz(self, schema: pyarrow.Schema) -> None: ...
Expand Down Expand Up @@ -219,9 +211,8 @@ 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],
max_commit_retries: Optional[int],
) -> None: ...
def convert_to_deltalake(
uri: str,
Expand Down
Loading

0 comments on commit 507b50e

Please sign in to comment.