Skip to content

Type mismatch from Julia #4

@hhoeschle

Description

@hhoeschle

Hey,

we call the spinedb_api from Julia in the following way:

@show id_list = [Int16(db_map.get_or_add_object_class(name=obj_class)[1]) for obj_class in object_classes]
@show typeof(id_list)
@show relationship_class = db_map.add_wide_relationship_class(name = relationship_name, object_class_id_list=id_list)

Unfortunately, when submitting the id_list to python it is translated in a numpy.int64 rather than an int. This leads to the problem that the relationship is not correctly created, as the object_class_id in the sql-db is stored as BLOB.

Would it be possible to integrate the following explicit typecast:

            for wide_kwargs in wide_kwargs_list:
                for dimension, object_class_id in enumerate(wide_kwargs["object_class_id_list"]):
                    narrow_kwargs = {
                        "id": id,
                        "dimension": dimension,
                        "object_class_id": int(object_class_id),
                        "name": wide_kwargs["name"],
                    }
                    item_list.append(narrow_kwargs)

I guess it may also occur at other places. I will collect and report them below.

Thanks
Hanspeter

Link to file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions