jorisvandenbossche commented on a change in pull request #10654:
URL: https://github.com/apache/arrow/pull/10654#discussion_r663900808



##########
File path: python/pyarrow/_dataset.pyx
##########
@@ -1057,6 +1057,23 @@ cdef class FileFragment(Fragment):
         Fragment.init(self, sp)
         self.file_fragment = <CFileFragment*> sp.get()
 
+    def __repr__(self):
+        type_name = frombytes(self.fragment.type_name())
+        if type_name != "parquet":
+            typ = " type={0}".format(type_name)
+        else:
+            # parquet has a subclass -> type embedded in class name
+            typ = ""
+        partition_dict = _get_partition_keys(self.partition_expression)
+        partition = ", ".join(
+            ["{0}={1}".format(key, val) for key, val in partition_dict.items()]

Review comment:
       I always forget in which Python version that was introduced, but it's 
Python 3.6, so indeed we can use f-strings!




-- 
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]


Reply via email to