Make ExtensionDtype.construct_array_type a regular method #36126
Labels
ExtensionArray
Extending pandas with custom dtypes or arrays.
Refactor
Internal refactoring of code
Strings
String extension data type and string data
Currently ExtensionDtype.consruct_array_type is a classmethod. This makes it hard to use a single dtype with multiple array classes where the array type depends on some parameter of the dtype.
I'd like to change construct_array_type to be a regular method rather than a classmethod. AFAICT, this is fine for pandas since everywhere we use construct_array_type we have an instance rather than a type. It should be fine for 3rd party arrays to continue to use classmethods since you can call a classmethod on an instance. The API breaking change would be for 3rd-party code relying on
ExtensionDtype.construct_array_type()
working (i.e. calling it on the class).My motivation is for allowing a parametrized
StringDtype
that can be used for either the current StringArray and an Arrow-backed StringArray.The text was updated successfully, but these errors were encountered: