Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Robustness to incorrect types; numpy.int64 cannot be converted

Open
#115 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
mysql, numpy, python
Domain
databases

Research direction

Start with ispyb/connector/mysqlsp/main.py and the call_sp_write path shown in the traceback, then inspect how arguments reach cursor.callproc. Reproduce the failure with a numpy.int64 value and determine whether the intended outcome is identifying the offending argument or improving the reported error; done criteria are not specified in the issue.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
7
Forks
11
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DiamondLightSource/ispyb-api

All issues in DiamondLightSource/ispyb-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.