Skip to content

update_metadata accepts string, but then breaks node #1226

@nmaytan

Description

@nmaytan

If you call update_metadata from a client, it will accept a simple string argument (as it is serializable), but then causes server 500's when doing anything with that node.

The metadata should be type checked before being accepted as an update.

client:

In [5]: l['C']
Out[5]: <ArrayClient shape=(10, 10) chunks=((10,), (10,)) dtype=float64>

In [6]: l['C'].update_metadata(metadata="test")

In [7]: l['C']
Scheduled retry in 0.54 seconds due to HTTPStatusError("Server error '500 Internal Server Error' for url 'http://localhost:8000/api/v1/metadata/C'\nFor more information, server admin can search server logs for correlation ID 576705178793e1d6.") (attempt 1)

server:

pydantic_core._pydantic_core.ValidationError: 1 validation error for NodeAttributes
metadata
  Input should be a valid dictionary [type=dict_type, input_value='test', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/dict_type

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