[Python] BaseExtensionType doesn't extend ExtensionType
Describe the enhancement requested
It would be nice if either (1) BaseExtensionType extended ExtensionType so that the class hierarchy makes sense, (2) there was some enum of all the type IDs that could be used for checking (I see lib.Type_FIXED_SIZE_LIST etc. but I don't think that's really meant for public use?). If we did this ideally it would be a Python enum and/or have a method to stringify the ID, too.
Component(s)
Python
Hello! My name is Bogdan, I'm part of EuroPython 2025 Sprints, and this issue has piqued my interest. I want to work on it, if you don't mind :)
I have following questions regarding this issue:
(1): could you please elaborate on what do you exactly mean by BaseExtensionType extending the ExtensionType? Right now it is the other way around: the ExtensionType inherits from the BaseExtensionType. Do you want to switch the order?
(2): do you think it would make more sense to have an enum for all types, or the type groups, e.g. TypesEnum vs SignedIntegersTypesEnum, etc.?
I want to work on the implementation of (2) in the meantime, I will open a PR with the proposed changes as soon as it's ready.
Ah I see...that confused me since I would have figured BaseExtensionType was an ABC, but rather it seems BaseExtensionType is the C++ class and ExtensionType is the Python-specific subclass. That's on me for not looking closely.
I think a single enum makes the most sense. Otherwise the categorization of types can get a little arbitrary (and there are already functions in pyarrow.types to try to establish these categories)
@lidavidm ok, then I will merge all existing enums that I've created into one common TypesEnum for all the types.
Issue resolved by pull request 47139 https://github.com/apache/arrow/pull/47139