Fix #2084: Handle 'none' severity value in TestResultDBRowSchema#2103
Fix #2084: Handle 'none' severity value in TestResultDBRowSchema#2103RamiNoodle733 wants to merge 1 commit intoelementary-data:masterfrom
Conversation
- Add validator to normalize "none" string values to None - This fixes validation errors when using dbt-fusion which returns "none" as a string instead of null/None - Add comprehensive tests for severity field validation
|
👋 @RamiNoodle733 |
📝 WalkthroughWalkthroughThe PR adds a pre-validator to the TestResultDBRowSchema that normalizes the severity field, converting string values of "none" (case-insensitive) and Python None to None, while preserving other values. Comprehensive unit tests validate the normalization behavior across multiple scenarios. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR fixes issue #2084 where the "none" severity value causes a validation error in
TestResultDBRowSchemawhen using dbt-fusion.Problem
dbt-fusion returns severity as the string "none" (lowercase) instead of
null/None. This caused a validation error:Solution
Added a Pydantic validator
normalize_severitytoTestResultDBRowSchemathat:NoneNonevalues correctlyChanges
elementary/monitor/fetchers/tests/schema.py- Addednormalize_severityvalidatortests/unit/monitor/fetchers/tests/test_schema.py- Comprehensive tests for severity validationTesting
All 8 new tests pass:
Fixes #2084
Summary by CodeRabbit
Release Notes