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 2022/06/17 16:08:36 UTC

[GitHub] [arrow] wesm commented on pull request #12460: ARROW-13530: [C++] Implement cumulative sum compute function

wesm commented on PR #12460:
URL: https://github.com/apache/arrow/pull/12460#issuecomment-1159026036

   I'm refactoring all the vector kernels and I observed that the behavior of this kernel is inconsistent between scalar and array inputs:
   
   A scalar null returns an array of length with 0 while an array with a single null returns an array with one null
   
   ```
   In [5]: pc.cumulative_sum(pa.array([None], type='int32')[0], skip_nulls=True)
   Out[5]: 
   <pyarrow.lib.Int32Array object at 0x7fa80d3e7640>
   [
     0
   ]
   
   In [6]: pc.cumulative_sum(pa.array([None], type='int32'), skip_nulls=True)
   Out[6]: 
   <pyarrow.lib.Int32Array object at 0x7fa80d3e7700>
   [
     null
   ]
   ```
   
   I'm not sure this is right -- I can preserve this behavior, but do we want to fix it? 


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