You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/26 11:57:58 UTC

[GitHub] [arrow] lidavidm commented on a change in pull request #10123: ARROW-12492: [Python] Helper method to decode DictionaryArray back to Array

lidavidm commented on a change in pull request #10123:
URL: https://github.com/apache/arrow/pull/10123#discussion_r620227560



##########
File path: python/pyarrow/array.pxi
##########
@@ -1990,6 +1990,12 @@ cdef class DictionaryArray(Array):
     def dictionary_encode(self):
         return self
 
+    def dictionary_decode(self):
+        """
+        Decodes the DictionaryArray to an Array.
+        """
+        return self.dictionary.take(self.indices)
+

Review comment:
       Just a thought, since the base `Array` has a `dictionary_encode` method and the `DictionaryArray` overrides it with a noop, should we also add a corresponding noop `dictionary_decode` to the base `Array`?




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

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