From bf8a85925cd422d3c6615e2978e1ee3393ba2b51 Mon Sep 17 00:00:00 2001 From: Liam Murphy Date: Fri, 22 Mar 2024 08:21:49 -0700 Subject: [PATCH 1/2] don't load metrics into JSON from rust compact / z-order calls --- python/deltalake/table.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/deltalake/table.py b/python/deltalake/table.py index 064ee3a83c..b720acda6f 100644 --- a/python/deltalake/table.py +++ b/python/deltalake/table.py @@ -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. @@ -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. @@ -1948,7 +1948,7 @@ def compact( custom_metadata, ) self.table.update_incremental() - return json.loads(metrics) + return metrics def z_order( self, @@ -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. @@ -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. @@ -2015,4 +2015,4 @@ def z_order( custom_metadata, ) self.table.update_incremental() - return json.loads(metrics) + return metrics From d81ca36aa2d14e867d64c135b15d997aa1139d7d Mon Sep 17 00:00:00 2001 From: Liam Murphy Date: Fri, 22 Mar 2024 08:37:43 -0700 Subject: [PATCH 2/2] fix deprecated optimizer call return type --- python/deltalake/table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/deltalake/table.py b/python/deltalake/table.py index b720acda6f..bc87b421de 100644 --- a/python/deltalake/table.py +++ b/python/deltalake/table.py @@ -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.