fix: handle false values correctly in (#823)

Fixes a critical bug in the from_runnable_config() method where falsy values (like False, 0, and empty strings) were being incorrectly filtered out, causing configuration fields to revert to their default values. The fix changes the filter condition from if v to if v is not None, ensuring only None values are skipped.
This commit is contained in:
Xun
2026-01-21 09:33:20 +08:00
committed by GitHub
parent 0e64c52975
commit 6ec170cde5
2 changed files with 52 additions and 7 deletions

View File

@@ -77,4 +77,4 @@ class Configuration:
for f in fields(cls)
if f.init
}
return cls(**{k: v for k, v in values.items() if v})
return cls(**{k: v for k, v in values.items() if v is not None})