Skip to content

fix: correct bool type converter for string "false" value - #20

Merged
codeasier merged 1 commit into
mainfrom
fix/bool-converter
Apr 17, 2026
Merged

codeasier merged 1 commit into
mainfrom
fix/bool-converter

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

Fix the bool type converter bug in both config.py and mapper.py. The converter was using bool(x) for strings, which returns True for any non-empty string including "false".

Changed to x.lower() in ("true", "1", "yes") to correctly handle common boolean string representations.

🔗 Related Issue

Fixes #12

🧪 Testing

  • Tests updated — bool converter now tested with "true", "false", "True", "False", "1", "0", "yes"
  • Manual testing completed

✅ Checklist

  • Code follows project guidelines
  • No new warnings introduced
  • Changes tested locally

The bool converter was using bool(x) for strings, which returns True
for any non-empty string including "false". Changed to
x.lower() in ("true", "1", "yes") which correctly handles common
boolean string representations.

Closes #12
@codeasier
codeasier merged commit 4d148fe into main Apr 17, 2026
5 checks passed
@codeasier
codeasier deleted the fix/bool-converter branch April 17, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] bool 类型转换器 bug — bool("false") 返回 True

1 participant