Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialisation errors in CLI client #280

Open
tpoliaw opened this issue Jul 26, 2023 · 3 comments
Open

Deserialisation errors in CLI client #280

tpoliaw opened this issue Jul 26, 2023 · 3 comments
Labels
cli Relates to CLI code client Relates to client code

Comments

@tpoliaw
Copy link
Contributor

tpoliaw commented Jul 26, 2023

Now all messages/events are sent on the same topic, the cli needs to check the type of each message received. Currently running an example plan raises many exceptions similar to

Exception in thread: 3 validation errors for ParsingModel[WorkerEvent]
__root__ -> state
  field required (type=value_error.missing)
__root__ -> doc
  extra fields not permitted (type=value_error.extra)
__root__ -> name
  extra fields not permitted (type=value_error.extra)
Traceback (most recent call last):
  File "/dls/athena/blueapi/src/blueapi/utils/thread_exception.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/dls/athena/blueapi/src/blueapi/messaging/stomptemplate.py", line 232, in _on_message
    sub.callback(frame)
  File "/dls/athena/blueapi/src/blueapi/messaging/stomptemplate.py", line 151, in wrapper
    value = parse_obj_as(obj_type, as_dict)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pydantic/tools.py", line 38, in pydantic.tools.parse_obj_as
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 3 validation errors for ParsingModel[WorkerEvent]
__root__ -> state
  field required (type=value_error.missing)
__root__ -> doc
  extra fields not permitted (type=value_error.extra)
__root__ -> name
  extra fields not permitted (type=value_error.extra)
@tpoliaw
Copy link
Contributor Author

tpoliaw commented Jul 26, 2023

Potential workaround in #249 to attempt to de-serialise DataEvents as well as WorkerEventss and then ignore everything it doesn't need.

@stan-dot
Copy link
Collaborator

stan-dot commented Mar 8, 2024

@tpoliaw what are the steps to reproduce the issue?

@stan-dot stan-dot added client Relates to client code cli Relates to CLI code labels Mar 8, 2024
@stan-dot
Copy link
Collaborator

stan-dot commented Mar 8, 2024

potentially connected to #206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Relates to CLI code client Relates to client code
Projects
None yet
Development

No branches or pull requests

2 participants