> assert parsed_event.model_dump_json(exclude_none=True) == json.dumps(event) E assert '{"payload":{"test_external_unique_id":"1234","some_key":"some_value"},"method":"values","namespace":[{"type":"static_value","value":"test.namespace"}],"values":[{"type":"json_path","...
yanyongyuchanged the titleFeature: 为model_dump增加exclude_*参数、添加type_validate_json函数Feb 17, 2024 View detailsyanyongyumerged commita830346intomasterFeb 17, 2024 41 of 43 checks passed yanyongyudeleted thefeature/pydantic-methodsbranchFebruary 17, 2024 15:18 ...
for attr, exclude_none in serialization_methods: if hasattr(obj, attr) and callable(getattr(obj, attr)): try: method = getattr(obj, attr) return ( method(exclude_none=exclude_none) if exclude_none else method() ) except Exception as e: logger.error( f"Failed to use {attr} to seriali...