kevinjqliu commented on code in PR #1499:
URL: https://github.com/apache/iceberg-python/pull/1499#discussion_r1907602687
##########
pyiceberg/partitioning.py:
##########
@@ -237,8 +237,7 @@ def partition_to_path(self, data: Record, schema: Schema)
-> str:
value_str = quote_plus(value_str, safe="")
Review Comment:
we can collapse this too
##########
tests/integration/test_partitioning_key.py:
##########
@@ -823,11 +789,6 @@ def test_partition_key(
snapshot.manifests(iceberg_table.io)[0].fetch_manifest_entry(iceberg_table.io)[0].data_file.file_path
)
# Special characters in partition value are sanitized when written to
the data file's partition field
- # Use `make_compatible_name` to match the sanitize behavior
- sanitized_record = (
- Record(**{make_compatible_name(k): v for k, v in
vars(expected_partition_record).items()})
- if make_compatible_name
- else expected_partition_record
- )
+ sanitized_record = Record(**{make_compatible_name(k): v for k, v in
vars(expected_partition_record).items()})
Review Comment:
we can either do this and run `make_compatible_name` for every test case
or we can set `make_compatible_name` as optional and only run for the
specific use case
```
make_compatible_name: Optional[Callable[[str], str]] = None,
....
if make_compatible_name:
....
```
which one do you prefer?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]