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

An action with `NDArray` return type doesn't work over HTTP

Open
#231 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fastapi, numpy, python
Domain
api, backend

Research direction

Start with the unit test added in #230 and trace the HTTP response serialization path for an action returning NDArray. The work is done when the test passes and NDArray responses serialize over HTTP in the same way as ArrayModel responses.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
An action with NDArray return type doesn't work over HTTP. It throws a the following error

pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'numpy.ndarray'>

ArrayModel can be used, but then it is typehinted incorrectly when called on the server

To Reproduce
See unit test added in #230

Expected behaviour
It serialises just as ArrayModel would.

System:

  • OS: Kubuntu 24.04
  • Python version. 3.11
  • Version. 0.0.13
Dominant language
Python
Stars
9
Forks
4
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

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 labthings/labthings-fastapi

All issues in labthings/labthings-fastapi

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.