Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-17096

[C++] Mode kernel incorrect for boolean inputs

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      In [1]: import pyarrow.compute as pc
      
      In [2]: import pyarrow as pa
      
      In [3]: pa.__version__
      Out[3]: '8.0.0'
      
      In [4]: pc.mode(pa.array([True, True]))
      # Correct
      Out[4]:
      <pyarrow.lib.StructArray object at 0x1266d5c60>
      -- is_valid: all not null
      -- child 0 type: bool
        [
          true
        ]
      -- child 1 type: int64
        [
          2
        ]
      
      # Incorrect
      In [5]: pc.mode(pa.array([True, False]), 2)
      Out[5]:
      <pyarrow.lib.StructArray object at 0x1262110c0>
      -- is_valid: all not null
      -- child 0 type: bool
        [
          false, # should be true
          false
        ]
      -- child 1 type: int64
        [
          1,
          1
        ] 

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            yibocai Yibo Cai Assign to me
            moeschke Matthew Roeschke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h

                Slack

                  Issue deployment