Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting BadValueError on Google App Engine Datastore Delete

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?

like image 382
etc Avatar asked Jul 01 '26 04:07

etc


1 Answers

Try updating your model so that the Districts field is not required (i.e., pass required=False as a keyword parameter to the Districts field). 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).

like image 124
David Underhill Avatar answered Jul 03 '26 16:07

David Underhill