Big-Life-Lab / PHES-ODM-Validation

A toolkit to assist in validating whether data conforms to the PHES-ODM dictionary.
https://validate-docs.phes-odm.org/
Creative Commons Attribution 4.0 International
5 stars 0 forks source link

[Bug]: missing phone number triggers min-length rule #226

Open zargot opened 1 week ago

zargot commented 1 week ago

Bug Description

@yulric, shouldn't this only trigger the missing-required-value rule when it's empty, if it's required in the first place?

error: contacts(phone, 2): Value "" (of length 0) is less than the min length of "10" [less_than_min_length]

The operating system on which the bug occured

linux

Python Version

3.8

yulric commented 1 week ago

Yes, since an empty string is considered null/missing, this should not trigger a length rule. It could trigger a missing values found rule if its enabled for that column.