Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python): return serialized optimize metrics as is #2316

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions python/deltalake/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ def __call__(
partition_filters: Optional[FilterType] = None,
target_size: Optional[int] = None,
max_concurrent_tasks: Optional[int] = None,
) -> Dict[str, Any]:
) -> str:
"""
!!! warning "DEPRECATED 0.10.0"
Use [compact][deltalake.table.DeltaTable.compact] instead, which has the same signature.
Expand All @@ -1893,7 +1893,7 @@ def compact(
min_commit_interval: Optional[Union[int, timedelta]] = None,
writer_properties: Optional[WriterProperties] = None,
custom_metadata: Optional[Dict[str, str]] = None,
) -> Dict[str, Any]:
) -> str:
"""
Compacts small files to reduce the total number of files in the table.

Expand All @@ -1918,7 +1918,7 @@ def compact(
custom_metadata: custom metadata that will be added to the transaction commit.

Returns:
the metrics from optimize
the metrics from optimize as a string

Example:
Use a timedelta object to specify the seconds, minutes or hours of the interval.
Expand Down Expand Up @@ -1948,7 +1948,7 @@ def compact(
custom_metadata,
)
self.table.update_incremental()
return json.loads(metrics)
return metrics

def z_order(
self,
Expand All @@ -1960,7 +1960,7 @@ def z_order(
min_commit_interval: Optional[Union[int, timedelta]] = None,
writer_properties: Optional[WriterProperties] = None,
custom_metadata: Optional[Dict[str, str]] = None,
) -> Dict[str, Any]:
) -> str:
"""
Reorders the data using a Z-order curve to improve data skipping.

Expand All @@ -1983,7 +1983,7 @@ def z_order(
custom_metadata: custom metadata that will be added to the transaction commit.

Returns:
the metrics from optimize
the metrics from optimize as a string

Example:
Use a timedelta object to specify the seconds, minutes or hours of the interval.
Expand Down Expand Up @@ -2015,4 +2015,4 @@ def z_order(
custom_metadata,
)
self.table.update_incremental()
return json.loads(metrics)
return metrics
Loading