mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 17:34:32 +02:00
Fix ValueTracker skipping type evaluation for empty strings
`ValueTracker.evaluate()` used `if not value` to skip NULL values, but this also skipped empty strings (`""`), `0`, and other falsy values. A CSV column containing only empty strings was incorrectly inferred as INTEGER (the initial default) instead of TEXT. Replace the falsy check with an explicit `if value is None` so that only NULL is skipped and all other values — including `""` — are evaluated against the type tests.
This commit is contained in:
parent
a947dc6739
commit
cffe30fd2f
2 changed files with 19 additions and 1 deletions
|
|
@ -490,7 +490,7 @@ class ValueTracker:
|
|||
return "text"
|
||||
|
||||
def evaluate(self, value: object) -> None:
|
||||
if not value or not self.couldbe:
|
||||
if value is None or not self.couldbe:
|
||||
return
|
||||
not_these: List[str] = []
|
||||
for name, test in self.couldbe.items():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue