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

[Python] Expressions not working with logical boolean operators (and, or, not)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0, 3.0.0
    • 4.0.0
    • Python

    Description

      There's a problem with boolean "and", "or" and "not" expressions when creating them in python (or I'm doing something completely stupid).

       

      >>> import pyarrow
      >>> pyarrow.__version__
      '3.0.0'
      >>> import pyarrow.dataset as ds
      >>> ds. scalar(False) and ds.scalar(True) # <--- I expect false
      <pyarrow.dataset.Expression true>
      >>> ds.scalar(True) and ds.scalar(False) # this works
      <pyarrow.dataset.Expression false>
      
      >>> ds.scalar(True) or ds.scalar(False) # this works
      <pyarrow.dataset.Expression true>
      >>> ds.scalar(False) or ds.scalar(True) # <--- I expect true
      <pyarrow.dataset.Expression false>
      
      >>> not ds.scalar(True)   # this works                                                                                                                                                                                                  
      False                                                                                                                                                                                                                       
      >>> not ds.scalar(False)      <--- I expect true                                                                                                                                                                                              
      False  
      

      I tried to figure out what goes wrong here, but there are no obvious problems in the python code, same for C++ (but I didn't quite understand everything of it yet).

       

      This happens with pyarrow3 and pyarrow2

       

       

      Attachments

        Activity

          People

            jorisvandenbossche Joris Van den Bossche
            romankarlstetter Roman Karlstetter
            Votes:
            0 Vote for this issue
            Watchers:
            3 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 40m
                1h 40m