Commit 57607d5
committed
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.1 parent 3331bbc commit 57607d5
2 files changed
+37
-4
lines changed| 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 | |
|---|---|---|---|
| |||
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