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] NumPy 2.0 compat: remove usage of np.core #39533

Closed
Tracked by #39532
jorisvandenbossche opened this issue Jan 9, 2024 · 0 comments · Fixed by #39535
Closed
Tracked by #39532

[Python] NumPy 2.0 compat: remove usage of np.core #39533

jorisvandenbossche opened this issue Jan 9, 2024 · 0 comments · Fixed by #39535
Assignees
Milestone

Comments

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Jan 9, 2024

Sub-issue of #39532

We have to fix the following warning (from nightly build with numpy 2.0.0.dev, eg https://github.com/ursacomputing/crossbow/actions/runs/7454906275/job/20283098411):

opt/conda/envs/arrow/lib/python3.10/site-packages/pyarrow/pandas_compat.py:33
  /opt/conda/envs/arrow/lib/python3.10/site-packages/pyarrow/pandas_compat.py:33: DeprecationWarning: numpy.core.numerictypes is deprecated and has been renamed to numpy._core.numerictypes. The numpy._core namespace contains private NumPy internals and its use is discouraged, as NumPy internals can change without warning in any release. In practice, most real-world usage of numpy.core is to access functionality in the public NumPy API. If that is the case, use the public NumPy API. If not, you are using NumPy internals. If you would still like to access an internal attribute, use numpy._core.numerictypes.sctypes.
    from numpy.core.numerictypes import sctypes as _np_sctypes
jorisvandenbossche added a commit to jorisvandenbossche/arrow that referenced this issue Jan 9, 2024
@jorisvandenbossche jorisvandenbossche added this to the 15.0.0 milestone Jan 9, 2024
jorisvandenbossche added a commit that referenced this issue Jan 10, 2024
### Rationale for this change

Removing usage of `np.core`, as that is deprecated and will be removed in numpy 2.0. 

For this specific case, we can just hardcode the list of data types instead of using a numpy api (this list doesn't typically change).

* Closes: #39533

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
raulcd pushed a commit that referenced this issue Jan 10, 2024
### Rationale for this change

Removing usage of `np.core`, as that is deprecated and will be removed in numpy 2.0. 

For this specific case, we can just hardcode the list of data types instead of using a numpy api (this list doesn't typically change).

* Closes: #39533

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
clayburn pushed a commit to clayburn/arrow that referenced this issue Jan 23, 2024
…pache#39535)

### Rationale for this change

Removing usage of `np.core`, as that is deprecated and will be removed in numpy 2.0. 

For this specific case, we can just hardcode the list of data types instead of using a numpy api (this list doesn't typically change).

* Closes: apache#39533

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
dgreiss pushed a commit to dgreiss/arrow that referenced this issue Feb 19, 2024
…pache#39535)

### Rationale for this change

Removing usage of `np.core`, as that is deprecated and will be removed in numpy 2.0. 

For this specific case, we can just hardcode the list of data types instead of using a numpy api (this list doesn't typically change).

* Closes: apache#39533

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this issue Feb 28, 2024
…pache#39535)

### Rationale for this change

Removing usage of `np.core`, as that is deprecated and will be removed in numpy 2.0. 

For this specific case, we can just hardcode the list of data types instead of using a numpy api (this list doesn't typically change).

* Closes: apache#39533

Authored-by: Joris Van den Bossche <jorisvandenbossche@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.

1 participant