Utilize polymorphic_serialization instead of Metaclass to adjust annotations#127
Utilize polymorphic_serialization instead of Metaclass to adjust annotations#127
Conversation
781d7a1 to
31bdbb6
Compare
Signed-off-by: Nijat Khanbabayev <nijat.khanbabayev@cubistsystematic.com>
31bdbb6 to
5367fd3
Compare
Signed-off-by: Nijat Khanbabayev <nijat.khanbabayev@cubistsystematic.com>
|
I think this is blocked by this: pydantic/pydantic#12382 Ex a build error. that occured: E pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'ccflow.tests.test_base_serialize.MyEnum'> Even though MyEnum has a pydantic core schema defined (it's a ccflow enum) Notably, the above issue states: That first recommendation is what we currently do with the MetaClass, and apply the SerializeAsAny annotation to pydantic BaseModels here: https://github.com/Point72/ccflow/blob/main/ccflow/base.py#L117
It seems we can't move off of that until these issues are addressed |
Signed-off-by: Nijat Khanbabayev <nijat.khanbabayev@cubistsystematic.com>
ff8c9e3 to
1ac3bd8
Compare
Signed-off-by: Nijat Khanbabayev <nijat.khanbabayev@cubistsystematic.com>
Signed-off-by: Nijat Khanbabayev <nijat.khanbabayev@cubistsystematic.com>
Test Results643 tests +3 641 ✅ +3 1m 41s ⏱️ ±0s Results for commit 74c1ae8. ± Comparison against base commit cde4fbb. This pull request removes 1 and adds 4 tests. Note that renamed tests count towards both. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #127 +/- ##
==========================================
+ Coverage 95.96% 96.02% +0.06%
==========================================
Files 140 141 +1
Lines 9680 9679 -1
Branches 563 551 -12
==========================================
+ Hits 9289 9294 +5
+ Misses 273 270 -3
+ Partials 118 115 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|


Utilize the
polymorphic_serializationflag introduced in this PR:pydantic/pydantic#12518
This PR will fail to build until a pydantic release has this feature in it.