Skip to content

Commit

Permalink
Simplify str of PartitionSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Zhang committed May 31, 2022
1 parent ca4f7e1 commit 5a1c185
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions python/src/iceberg/table/partitioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ def __str__(self):
Only include list of partition fields in the PartitionSpec's string representation
"""
result_str = "["
for partition_field in self.fields:
result_str += f"\n {str(partition_field)}"
if len(self.fields) > 0:
result_str += "\n"
if self.fields:
result_str += "\n " + "\n ".join([str(field) for field in self.fields]) + "\n"
result_str += "]"
return result_str

Expand Down

0 comments on commit 5a1c185

Please sign in to comment.