Skip to content

fix: ValueTracker.evaluate() should not skip falsy values like 0 - #863

Closed
KooshaPari wants to merge 1 commit into
simonw:mainfrom
KooshaPari:fix-5-valuetracker-falsy
Closed

KooshaPari wants to merge 1 commit into
simonw:mainfrom
KooshaPari:fix-5-valuetracker-falsy

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Sep 13, 2026

Copy link
Copy Markdown

Bug

ValueTracker.evaluate() used if not value to skip empty/None values, but this also skipped falsy values like 0, False, and empty strings "". This caused incorrect type detection for columns containing only falsy values - for example, a column of all empty strings would be guessed as integer instead of text.

Fix

Changed if not value or not self.couldbe to if value is None or not self.couldbe so that only None is skipped, while falsy values like 0, False, and "" are properly evaluated.

Testing

  • Added test_value_tracker_evaluates_falsy_zero - verifies zeros narrow to integer
  • Added test_value_tracker_evaluates_falsy_empty_string - verifies empty strings narrow to text
  • Added test_value_tracker_evaluates_falsy_false - verifies False narrows to integer
  • All 22 tests in test_utils.py pass

📚 Documentation preview 📚: https://sqlite-utils--863.org.readthedocs.build/en/863/

Copilot AI lite review requested due to automatic review settings September 13, 2026 06:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@KooshaPari KooshaPari closed this by deleting the head repository Sep 13, 2026
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.

2 participants