From 3756e4efadee75d366024a5c9bc3d3558c26916a Mon Sep 17 00:00:00 2001 From: Sreesh Maheshwar Date: Sat, 21 Dec 2024 21:00:08 +0000 Subject: [PATCH] Use `quote_plus` instead of `quote` to match Java behaviour --- pyiceberg/partitioning.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyiceberg/partitioning.py b/pyiceberg/partitioning.py index 872b084f05..c9b6316f59 100644 --- a/pyiceberg/partitioning.py +++ b/pyiceberg/partitioning.py @@ -30,7 +30,7 @@ Tuple, TypeVar, ) -from urllib.parse import quote +from urllib.parse import quote_plus from pydantic import ( BeforeValidator, @@ -234,10 +234,10 @@ def partition_to_path(self, data: Record, schema: Schema) -> str: partition_field = self.fields[pos] value_str = partition_field.transform.to_human_string(field_types[pos].field_type, value=data[pos]) - value_str = quote(value_str, safe="") + value_str = quote_plus(value_str, safe="") value_strs.append(value_str) - field_str = quote(partition_field.name, safe="") + field_str = quote_plus(partition_field.name, safe="") field_strs.append(field_str) path = "/".join([field_str + "=" + value_str for field_str, value_str in zip(field_strs, value_strs)])