Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always use specific null values for fixed fields
This came out of an attempt to address the mysterious testing problems from PR #2563 and turned into a big old debacle. As it turns out, the problem came from calling Item.from_path and getting None for fields that weren't filled out by the MediaFile data. Everywhere else, we fill out these fixed attributes with the special null value for the field's type, so it's actually pretty confusing that these could mysteriously become None. I think it will be saner all around if we enforce this universally. There were two possible fixes: one in __getitem__ to check for missing values and one that set all the missing values in the constructor. I opted for the former because it has a smaller footprint, but the latter might have slightly better performance (depending on the ratio of constructions to lookups).
- Loading branch information