I am trying to delete records in the datastore. Unfortunately, whenever I try to delete the items, it gives me a BadValueError, saying Districts (one of the columns) is required. Because of an issue with the bulk loader, Districts is null for all of the rows…but I still need to clean out the datastore to try to fix the bulk loader error.
What can I do?
Try updating your model so that the
Districtsfield is not required (i.e., passrequired=Falseas a keyword parameter to theDistrictsfield). Then the validator shouldn’t complain about the existing entities and you should be able to delete the entities.Alternatively, if you know the keys for the entities you want to delete, you can delete them directly using
db.delete()without ever needing to fetch them in the first place.You might even be able to use the datastore viewer from the Dashboard to delete them (if you don’t have many entities to delete, this might be easiest).