We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
AeromancyStruct.validate
[...] src/colocation/colocation.py:29: in __init__ self.metadata.validate() .venv/lib/python3.10/site-packages/aeromancy/struct.py:87: in validate self.decode(self.encode(format="msgpack"), format="msgpack") _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ cls = <class 'colocation.structs.Metadata'> encoded_bytes = b'\x83\xabinstruments\x9d\x91\x8d\xadinstrument_id\xa8ref-PM25\xafinstrument_type\x01\xa9pollutant\xa4pm25\xaftime_res...etary\xa4note\xc0\xa5parts\xc0\xa9num_parts\x01\xafgps_coordinates\x92\xcb@P6\x1f\xc8\xf3#y\xcb\xc0bwF\xf7\xa0\xb5\xee' format = 'msgpack' @classmethod def decode(cls, encoded_bytes: bytes, format: str): """Deserialize this `msgspec.Struct` from bytes. Parameters ---------- encoded_bytes Bytes to attempt to deserialize. format The format to used to encode the `msgspec.Struct`. This can be "yaml", "json", or "msgpack". Returns ------- An instance of this class decoded according to `format`. """ match format: case "yaml": return msgspec.yaml.decode(encoded_bytes, type=cls) case "json": return msgspec.json.decode(encoded_bytes, type=cls) case "msgpack": > return msgspec.msgpack.decode(encoded_bytes, type=cls) E msgspec.ValidationError: Expected `object`, got `array` - at `$.instruments[0]` .venv/lib/python3.10/site-packages/aeromancy/struct.py:71: ValidationError
Catching and rethrowing the message with more details should help substantially.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Catching and rethrowing the message with more details should help substantially.
The text was updated successfully, but these errors were encountered: