pitrou commented on PR #14499: URL: https://github.com/apache/arrow/pull/14499#issuecomment-1292157095
This patch should help fix the 3.11 enum issue: ```diff diff --git a/python/pyarrow/_fs.pyx b/python/pyarrow/_fs.pyx index e7b028a07..557c08149 100644 --- a/python/pyarrow/_fs.pyx +++ b/python/pyarrow/_fs.pyx @@ -78,6 +78,12 @@ cdef CFileType _unwrap_file_type(FileType ty) except *: assert 0 +def _file_type_to_string(ty): + # Python 3.11 changed str(IntEnum) to return the string representation + # of the integer value: https://github.com/python/cpython/issues/94763 + return f"{ty.__class__.__name__}.{ty._name_}" + + cdef class FileInfo(_Weakrefable): """ FileSystem entry info. @@ -185,9 +191,10 @@ cdef class FileInfo(_Weakrefable): except ValueError: return '' - s = '<FileInfo for {!r}: type={}'.format(self.path, str(self.type)) + s = (f'<FileInfo for {self.path!r}: ' + f'type={_file_type_to_string(self.type)}') if self.is_file: - s += ', size={}'.format(self.size) + s += f', size={self.size}' s += '>' return s ``` -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org