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

[Python] Support ChunkedArray mask in replace operations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • pyarrow==9.0.0
      python 3.9

    Description

      Replace operations (more specifically replace_with_mask) don't support chunked array for the mask argument.

      But one would expect that ReplaceMaskChunked, which support chunked array for  its input data (the data to be replaced), should also support chunked array for its mask.

       

      pc.replace_with_mask(pa.array(["a", "b"]), pa.array([True, False]), pa.scalar("c", pa.string()))
      
      pc.replace_with_mask(
          pa.chunked_array([pa.array(["a", "b"])]),
          pa.array([True, False]),
          pa.scalar("c", pa.string()),
      )
      
      with pytest.raises(pa.ArrowInvalid, match=r"Mask must be array or scalar, not ChunkedArray"):
          pc.replace_with_mask(
              pa.chunked_array([pa.array(["a", "b"])]),
              pa.chunked_array([pa.array([True, False])]),
              pa.scalar("c", pa.string()),
          ) 

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            0x26dres &res
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: