Commit 28daf9f
fix: allow null materialization in ModelAlertDataSchema for ClickHouse compatibility (#2180)
When ClickHouse stores NULL for the materialization column in alerts_v2,
the JSON data contains "materialization": null. The Pydantic schema
rejected this with 'none is not an allowed value' because materialization
was typed as str (required, non-nullable).
This change makes materialization Optional[str] in both the schema and
the alert model, and handles None gracefully in string formatting.
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Yosef Arbiv <yosef.arbiv@gmail.com>1 parent 4b52f6b commit 28daf9f
File tree
2 files changed
+5
-3
lines changed- elementary/monitor
- alerts
- fetchers/alerts/schema
2 files changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
0 commit comments