How to define 'export_transform' within bullkloader, if ndb.KeyProperty(repeated=True)?

59 views
Skip to first unread message

Hooman Korasani

unread,
Jul 5, 2013, 6:42:05 AM7/5/13
to appengine-...@googlegroups.com
Hi,

I would really appreciate it if someone could help me with this:

In a nut shell, because I am using a KeyProperty(repeated=True), which in itself is a list, I get the following error message, when downloading data:

google.appengine.ext.bulkload.bulkloader_errors.ErrorOnTransform: Error on transform. Property: 
friends External Name: friends. Code: transform.key_id_or_name_as_string Details: 'list' object has no attribute 'to_path'


class User(ndb.Model):
    firstname = ndb.StringProperty()
    friends = ndb.KeyProperty(kind='User', repeated=True) 

- kind: User
  connector: csv
  connector_options:
    # TODO: Add connector options here--these are specific to each connector.
  property_map:
    - property: __key__
      external_name: key
      export_transform: transform.key_id_or_name_as_string

    - property: firstname
      external_name: firstname
      # Type: String Stats: 2 properties of this type in this kind.

    - property: friends
      external_name: friends
      # Type: Key Stats: 2 properties of this type in this kind.
      import_transform: transform.create_foreign_key('User')
      export_transform: transform.key_id_or_name_as_string

There is also a SO version:
http://stackoverflow.com/questions/17485250/gae-error-when-downloading-data-if-ndb-keypropertyrepeated-true
Reply all
Reply to author
Forward
0 new messages