There seems to be very little information regarding loading Entities with parent keys using the bulkloader for App Engine. I tried following the instructions that I found on here on StackOverflow...
Uploading Entity with Parent Using Bulkloader
But there must be something I'm still not getting. I was hoping you all could help.
I am trying to load new Entities and give them the parent key of an Entity already in the Datastore. The parent Entity is basically just an "Admin" entity. I want all the "Car" entities that belong to the administrator to have this parent key. This way I can easily search for just those Cars.
The admin.yml and admin.csv are as follows... (I'm skipping the preamble & "transformers")
ADMIN.YML
- kind: Admin
connector: csv
property_map:
- property: __key__
external_name: adminKey
export_transform: transform.key_id_or_name_as_string
- property: email
external_name: email
ADMIN.CSV
email
foo@foo.com
This works fine. A single Admin entity is created.
Now I want to use this entity as the parent of the "Car" entities that I load next. The car.yml and car.csv are below... (again skipping the preamble & "transformers")
CAR.YML
- kind: Car
connector: csv
property_map:
- property: __key__
external_name: carKey
import_transform: transform.create_deep_key(('adminKey', 'adminKey'),('carKey', transform.CURRENT_PROPERTY))
export:
- external_name: adminKey
export_transform: transform.key_id_or_name_as_string_n(0)
- external_name: carKey
export_transform: transform.key_id_or_name_as_string_n(1)
- property: manufacturer
external_name: manufacturer
- property: model
external_name: model
CAR.CSV
manufacturer,model
Chevrolet,Impala
Ford,Focus
Each time I run car.yml with car.csv, I get the message:
[ERROR ] Error in WorkerThread-0: 'adminKey'
I am simply lost at this point. Posting links mostly likely won't help. I've probably seen all of them and still can't seem to understand.
Thanks in advance.