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

[Python] pa.array mask inverted when type is binary and value to be converted is numpy array

    XMLWordPrintableJSON

Details

    Description

      Python 3.9.2 | packaged by conda-forge | (default, Feb 21 2021, 05:02:46)                                   
      [GCC 9.3.0] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import numpy as np
      >>> import pyarrow as pa
      >>>
      >>> pa.array(np.array([b'\x00']),type=pa.binary(1), mask = np.array([False]))
      <pyarrow.lib.FixedSizeBinaryArray object at 0x7fa080ca3640>
      [
        null
      ]
      >>> pa.array(np.array([b'\x00']),type=pa.binary(1), mask = np.array([True]))
      <pyarrow.lib.FixedSizeBinaryArray object at 0x7fa080ca3700>
      [
        00
      ]
      >>> pa.array([b'\x00'],type=pa.binary(1), mask = np.array([False]))
      <pyarrow.lib.FixedSizeBinaryArray object at 0x7fa083cc9520>
      [
        00
      ]
      >>> pa.__version__
      '3.0.0'
      >>> np.__version__
      '1.20.1'
      

      Happens both with FixedSizeBinary and variable sized binary (I was working with FixedSizeBinary). Does not happen for integers (presumably other types, didn't exhaustively check)?

      Attachments

        Issue Links

          Activity

            People

              amol- Alessandro Molina
              nugend Daniel Nugent
              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 - 3h 40m
                  3h 40m