4

bulkoader.yaml:

transformers: 
    - kind: ExampleModel 
      connector: csv 
      property_map: 
        - property: __key__ 
          external_name: key 
          export_transform: transform.key_id_or_name_as_string 
        - property: data 
          external_name: data 
        - property: type 
          external_name: type 

model.py:

class ExampleModel(db.Model): 
        data = db.TextProperty(required=True) 
        type = db.StringProperty(required=True) 

Everything seems to be fine, yet when I upload I get this error: BadValueError: Property data is 24788 bytes long; it must be 500 or less. Consider Text instead, which can store strings of any length.

For some reason, it thinks data is a string property.

Any one know how I can fix this?

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
Matthew H
  • 5,831
  • 8
  • 47
  • 82

1 Answers1

9

You need to specify an import transform for the text field, like this:

- property: data
  external_name: data
  import_transform: db.Text
Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
  • Thanks. But now I get: Error parsing yaml file: Unable to assign value 'db.Text' to attribute 'import_transform': Invalid code for import_transform. Code: "db.Text". Details: name 'db' is not defined in "bulkloader.yaml", line 33, column 29 – Matthew H Aug 08 '10 at 13:24
  • 1
    You need to add "from google.appengine.ext import db" to your Python imports section. – Nick Johnson Aug 08 '10 at 15:45
  • Ah! That was so simple. >_> Thanks Nick! – Matthew H Aug 08 '10 at 16:00
  • Hi Nick, I've added "import_transform: db.Text" to the bulkloader.yaml but I'm still seeing an error: BadValueError: Property story_html is 3132 bytes long; it must be 500 or less. Consider Text instead, which can store strings of any length. – ehfeng Oct 16 '11 at 11:21
  • Thanks Nick, That was useful ! :) – Amyth May 30 '12 at 21:13