Skip to content

native to_java_float_array raises AttributeError for a list when NumPy is not installed #433

Closed

Description

@shaunpatterson

Summary

On the native package, arcadedb.to_java_float_array([0.1, 0.2]) raises AttributeError: 'NoneType' object has no attribute 'asarray' when NumPy is not installed. NumPy is an optional extra of arcadedb (arcadedb[numpy], native/wheel/pyproject.toml; installation.adoc says the package needs no other dependency), and the docstring lists plain Python lists as accepted input.

Cause

vector.py imports NumPy in a try and sets _np = None when it is missing. The native branch of to_java_float_array calls _np.asarray(...) without testing for that, because the array it returns is a NumPy float32 array.

Reproduction

import arcadedb

print(arcadedb.__backend__, arcadedb.__version__)
try:
    arcadedb.to_java_float_array([0.1, 0.2])
except Exception as e:
    print(type(e).__name__, e)

In an environment without NumPy (uv run --no-project --with arcadedb==26.11.1.post4 python repro.py, macOS arm64, Python 3.12):

native 26.11.1.post4
AttributeError 'NoneType' object has no attribute 'asarray'

Expected

An ImportError that names the extra. The function returns a NumPy float32 array on the native build, so without NumPy there is nothing to return.

Activity

  1. added
    in progress
    bug
    native
    python
    vector
    on Nov 21, 2026
  2. added this to the 26.12.1 milestone on Nov 21, 2026
  3. added a commit that references this issue on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugin progressnativepythonvector

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions