Commit 65d3bcf
authored
Fix Pydantic 2.12+ compatibility for custom FieldInfo with Annotated types (#727)
Fix Pydantic 2.12+ compatibility for custom FieldInfo with Annotated types
Pydantic 2.12+ converts custom FieldInfo subclasses to plain PydanticFieldInfo
for fields using Annotated types with metadata (like Coordinates). This caused
custom attributes like index, sortable, etc. to be lost.
Fix: Capture original FieldInfo objects before Pydantic processes them and
restore them when Pydantic has converted them to plain PydanticFieldInfo.
* Exclude mypy on PyPy to avoid librt build failure
mypy 1.19+ depends on librt which only has CPython wheels.
When Poetry tries to install on PyPy, it falls back to building
from source, which fails because librt uses CPython-specific C APIs.1 parent 78b73b2 commit 65d3bcf
File tree
5 files changed
+137
-5
lines changed- .github/workflows
- aredis_om/model
- tests
5 files changed
+137
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2068 | 2068 | | |
2069 | 2069 | | |
2070 | 2070 | | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
2071 | 2080 | | |
2072 | 2081 | | |
2073 | 2082 | | |
| |||
2141 | 2150 | | |
2142 | 2151 | | |
2143 | 2152 | | |
| 2153 | + | |
2144 | 2154 | | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
2145 | 2158 | | |
2146 | | - | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
2147 | 2171 | | |
2148 | 2172 | | |
2149 | 2173 | | |
2150 | 2174 | | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
2151 | 2178 | | |
2152 | 2179 | | |
2153 | 2180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1528 | 1528 | | |
1529 | 1529 | | |
1530 | 1530 | | |
1531 | | - | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
1532 | 1534 | | |
1533 | 1535 | | |
1534 | 1536 | | |
| |||
1543 | 1545 | | |
1544 | 1546 | | |
1545 | 1547 | | |
1546 | | - | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
1547 | 1551 | | |
1548 | | - | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
1549 | 1555 | | |
1550 | 1556 | | |
1551 | 1557 | | |
| |||
0 commit comments