Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] C++ Extension Types aren't correctly exposed in pyarrow #33801

Closed
sjperkins opened this issue Jan 20, 2023 · 1 comment · Fixed by #33802
Closed

[Python] C++ Extension Types aren't correctly exposed in pyarrow #33801

sjperkins opened this issue Jan 20, 2023 · 1 comment · Fixed by #33802

Comments

@sjperkins
Copy link
Contributor

Describe the bug, including details regarding any error messages, version, and platform.

Version: master branch (11.0.0)
Platform: Ubuntu 20.04

Neither __arrow_ext_class__ nor __arrow_ext_scalar_class__ are exposed on BaseExtensionType.

This results in the following sort of errors when trying to access a C++ ExtensionArray/ExtensionType from pyarrow:

AttributeError: 'pyarrow.lib.BaseExtensionType' object has no attribute '__arrow_ext_class__'

See the following, for example:

Component(s)

Python

@kou kou changed the title C++ Extension Types aren't correctly exposed in pyarrow [Python] C++ Extension Types aren't correctly exposed in pyarrow Jan 21, 2023
jorisvandenbossche pushed a commit that referenced this issue Feb 16, 2023
…ow (#33802)

* Closes #33801 

### Rationale for this change

C++ Extension Types are not correctly exposed in pyarrow

### What changes are included in this PR?

`__arrow_ext_class__` and `__arrow_ext_scalar_class__` have been moved from `ExtensionType` to `BaseExtensionType` in types.pxi.

### Are these changes tested?

Yes, a test has been added to `test_cython.py`. There may be better locations for this, but the existing cython testing machinery here is useful for generating a C++ extension type on the fly.

### Are there any user-facing changes?

I don't believe there are any user-facing changes as `__arrow_ext_class__` and `__arrow_ext_scalar_class__` are moved into a base class.

Authored-by: Simon Perkins <simon.perkins@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
@jorisvandenbossche jorisvandenbossche added this to the 12.0.0 milestone Feb 16, 2023
@jorisvandenbossche
Copy link
Member

Issue resolved by pull request 33802
#33802

gringasalpastor pushed a commit to gringasalpastor/arrow that referenced this issue Feb 17, 2023
… pyarrow (apache#33802)

* Closes apache#33801 

### Rationale for this change

C++ Extension Types are not correctly exposed in pyarrow

### What changes are included in this PR?

`__arrow_ext_class__` and `__arrow_ext_scalar_class__` have been moved from `ExtensionType` to `BaseExtensionType` in types.pxi.

### Are these changes tested?

Yes, a test has been added to `test_cython.py`. There may be better locations for this, but the existing cython testing machinery here is useful for generating a C++ extension type on the fly.

### Are there any user-facing changes?

I don't believe there are any user-facing changes as `__arrow_ext_class__` and `__arrow_ext_scalar_class__` are moved into a base class.

Authored-by: Simon Perkins <simon.perkins@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
fatemehp pushed a commit to fatemehp/arrow that referenced this issue Feb 24, 2023
… pyarrow (apache#33802)

* Closes apache#33801 

### Rationale for this change

C++ Extension Types are not correctly exposed in pyarrow

### What changes are included in this PR?

`__arrow_ext_class__` and `__arrow_ext_scalar_class__` have been moved from `ExtensionType` to `BaseExtensionType` in types.pxi.

### Are these changes tested?

Yes, a test has been added to `test_cython.py`. There may be better locations for this, but the existing cython testing machinery here is useful for generating a C++ extension type on the fly.

### Are there any user-facing changes?

I don't believe there are any user-facing changes as `__arrow_ext_class__` and `__arrow_ext_scalar_class__` are moved into a base class.

Authored-by: Simon Perkins <simon.perkins@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants