Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-9715

cppIndex should raise Python's built-in IndexError

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: utils
    • Labels:
      None
    • Story Points:
      0.5
    • Epic Link:
    • Sprint:
      Alert Production S17 - 3
    • Team:
      Alert Production

      Description

      In order to synthesis __iter__ from __getitem__ Python apparently requires exactly IndexError to be thrown, so that's what we should throw in these functions.

      That will require rewriting the testPybind11.cc unit test in a way that has access to Python symbols (which should be done anyway).

      There will likely be workaround code in afw/table/python/catalog.h that can be cleaned up after this change (I'll just catch OutOfRangeError there and re-throw as IndexError).

        Attachments

          Activity

          Hide
          jbosch Jim Bosch added a comment -

          afw now has several more workarounds. Please grep for "DM-9715" to catch them all.

          Show
          jbosch Jim Bosch added a comment - afw now has several more workarounds. Please grep for " DM-9715 " to catch them all.
          Hide
          rowen Russell Owen added a comment -

          For simplicity I wrapped cppIndex with pybind11 and moved the unit test into Python (in testPybind11.py).

          Show
          rowen Russell Owen added a comment - For simplicity I wrapped cppIndex with pybind11 and moved the unit test into Python (in testPybind11.py).
          Hide
          rowen Russell Owen added a comment -

          If any one of you has time to review this please delete the other two reviewers and take it. It's very small: changes to python.h, adding a simple python.cc file and moving test code from pybind11.cc (now gone) to pybind11.py

          Show
          rowen Russell Owen added a comment - If any one of you has time to review this please delete the other two reviewers and take it. It's very small: changes to python.h, adding a simple python.cc file and moving test code from pybind11.cc (now gone) to pybind11.py
          Hide
          pschella Pim Schellart [X] (Inactive) added a comment -

          See PR for minor comments.

          Show
          pschella Pim Schellart [X] (Inactive) added a comment - See PR for minor comments.

            People

            Assignee:
            rowen Russell Owen
            Reporter:
            jbosch Jim Bosch
            Reviewers:
            Jim Bosch, Pim Schellart [X] (Inactive)
            Watchers:
            Jim Bosch, Krzysztof Findeisen, Pim Schellart [X] (Inactive), Russell Owen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.