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/21 15:02:46 UTC

[GitHub] [arrow] amol- opened a new pull request #10123: ARROW-12492: [Python] Helper method to decode DictionaryArray back to Array

amol- opened a new pull request #10123:
URL: https://github.com/apache/arrow/pull/10123


   


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



[GitHub] [arrow] lidavidm closed pull request #10123: ARROW-12492: [Python] Helper method to decode DictionaryArray back to Array

Posted by GitBox <gi...@apache.org>.
lidavidm closed pull request #10123:
URL: https://github.com/apache/arrow/pull/10123


   


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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
amol- commented on a change in pull request #10123:
URL: https://github.com/apache/arrow/pull/10123#discussion_r620370903



##########
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:
       I thought about that, but I realised it didn't make much sense to expose a `dictionary_decode` method in `Array` which is not dictionary encoded.
   On the opposite a `dictionary_encode` method makes sense on `Array` as it's something that can be dictionary encoded.




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



[GitHub] [arrow] github-actions[bot] commented on pull request #10123: ARROW-12492: [Python] Helper method to decode DictionaryArray back to Array

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #10123:
URL: https://github.com/apache/arrow/pull/10123#issuecomment-824161874


   https://issues.apache.org/jira/browse/ARROW-12492


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