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

[Python] Add dynamic attributes to PyArrow ExtensionArray

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • 0.16.0
    • None
    • Python
    • Ubuntu 19.10 + Python 3.7

    Description

      In the present implementation, the interface of the class `ExtensionArray` is not extendable by user. One can not easily inherit from it, as the constructor _init_ can not be called directly, or it does not allow adding dynamically atttributes.

      Keeping the current design with build methods `from_*`, I believe it could then make sense to allow dynamic attributes in `ExtensionArray` (see https://cython.readthedocs.io/en/latest/src/userguide/extension_types.html#dynamic-attributes). The runtime & size cost of the Python objects would be fairly minimal, compared to increased flexibility it would allow.

      A typical use case where it could be useful would be dynamic mixins (added by custom Factory), allowing projects based on PyArrow to extend (! ) the interface with specific business logic. 

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              balancap Paul Balanca
              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
                  1h