jorisvandenbossche commented on PR #13454: URL: https://github.com/apache/arrow/pull/13454#issuecomment-1177140141
One small comment: this method should maybe be not "public" on the type? (there should be no reason for a _user_ of the extension type (not implementor) to ever call this method on the type object) So we could also follow the similar pattern as the other non-public methods we already have that can be overridden and call this something like `__arrow_ext_scalar_as_py__` ? --- Something that I didn't think about when opening the JIRA originally, but a potentially different way to enable basically the same ability to override `as_py()` would be to allow the user to sublcass `ExtensionScalar`, and then specify this class (in the same way as you can sublcass `ExtensionArray`, and specify this in `ExtensionType.__arrow_ext_class__`). That way, you have full control over that scalar class (and for example also add custom attributes), and thus also can override the default `as_py()` method. I am not really sure this is a better way, though (it's a bit more generic, but the question is whether this will be needed in practice). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
