Skip to content

Comments

BEC Messages Refactor 1: mark all message dicts as jsonable#762

Draft
d-perl wants to merge 1 commit intomainfrom
refactor/improve_message_typing
Draft

BEC Messages Refactor 1: mark all message dicts as jsonable#762
d-perl wants to merge 1 commit intomainfrom
refactor/improve_message_typing

Conversation

@d-perl
Copy link
Contributor

@d-perl d-perl commented Feb 10, 2026

To facilitate migrating to a language-agnostic messaging structure, we should avoid use of custom types in unstructured data. This is step one towards that goal: annotating all dict[unknown, unknown] as JSON/msgpack compatible types, and ignoring numpy types for now. This change introduces a substantial performance penalty which will be removed in the next iteration when we can rely on only the in-rust part of pydantic validation and not the many python checks on each object in a dictionary. The next step is to replace all numpy-containing objects with structured pydantic models and refactor the code base to support this, which mostly already exists in #761 but will be tidier on this base. It will require some small changes to BW and OD.

@d-perl d-perl force-pushed the refactor/improve_message_typing branch 9 times, most recently from 71c56e5 to 1dce098 Compare February 10, 2026 20:26
@d-perl d-perl force-pushed the refactor/improve_message_typing branch from 1dce098 to ce76ee2 Compare February 10, 2026 21:06
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 85.48387% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bec_lib/bec_lib/one_way_registry.py 80.39% 7 Missing and 3 partials ⚠️
bec_lib/bec_lib/messages.py 88.88% 4 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@d-perl d-perl changed the title WIP refactor: mark all message dicts as jsonable Messaging Refactor 1: mark all message dicts as jsonable Feb 11, 2026
@d-perl d-perl changed the title Messaging Refactor 1: mark all message dicts as jsonable BEC Messages Refactor 1: mark all message dicts as jsonable Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant