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

[Python] Fix repr and contains of StructScalar with duplicate field names

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0
    • Python

    Description

      Broken off from ARROW-9997

      When having duplicate fields, the repr fails:

      In [28]: s = pa.scalar([('a', 1), ('b', 2), ('a', 3)], pa.struct([('a', 'int64'), ('b', 'int64'), ('a', 'int64')]))
      
      In [29]: 0 in s
      Out[29]: True
      
      In [30]: s
      ....
      KeyError: 'a'
      

      In addition, the contains (in) operation also shouldn't accept integers (this is also the case for non-duplicate fields)

      Attachments

        Issue Links

          Activity

            People

              jorisvandenbossche Joris Van den Bossche
              jorisvandenbossche Joris Van den Bossche
              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 - 2h 40m
                  2h 40m