You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2023/02/20 21:43:14 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #15196: GH-15195: [C++][FlightRPC][Python] Add ToString/Equals for Flight types

lidavidm commented on code in PR #15196:
URL: https://github.com/apache/arrow/pull/15196#discussion_r1112341990


##########
python/pyarrow/_flight.pyx:
##########
@@ -536,12 +545,7 @@ cdef class FlightDescriptor(_Weakrefable):
         return self.descriptor.path
 
     def __repr__(self):
-        if self.descriptor_type == DescriptorType.PATH:
-            return "<FlightDescriptor path: {!r}>".format(self.path)
-        elif self.descriptor_type == DescriptorType.CMD:
-            return "<FlightDescriptor command: {!r}>".format(self.command)
-        else:
-            return "<FlightDescriptor type: {!r}>".format(self.descriptor_type)
+        return frombytes(self.descriptor.ToString())

Review Comment:
   Sorry, I've been distracted as of late. I can rework the Python parts of this so that we have custom Pythonic `__repr__` implementations. I originally did the Python changes here just because I figured I'd reduce the duplication while I was already rooting around here, but it's be better to give a good experience for Python users.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org