Skip to content

Robustness to incorrect types; numpy.int64 cannot be converted #115

@ndevenish

Description

@ndevenish

Spent some time tracking down an annoying calling error:

Traceback (most recent call last):
File "i24ssx_Chip_Collect_py3v1.py", line 293, in create_dcid
    dcid = conn.mx_acquisition.upsert_data_collection(list(dc_params.values()))
File ".../site-packages/ispyb/sp/acquisition.py", line 166, in upsert_data_collection
    return self.get_connection().call_sp_write("upsert_dc", values)
File ".../site-packages/ispyb/connector/mysqlsp/main.py", line 88, in call_sp_write
    result_args = cursor.callproc(procname=procname, args=args)
File ".../site-packages/mysql/connector/cursor_cext.py", line 466, in callproc
    "Failed calling stored routine; {0}".format(err))
mysql.connector.errors.InterfaceError: Failed calling stored routine; Python type numpy.int64 cannot be converted

Calling API had provided a numpy.int64 instead of an int. This looks like an int in __str__ and __repr__ so took an annoyingly long time to track down. I wonder if it'd be possible to tell which value caused this error, at least.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions