App Engine BadValueError批量数据上传 - TextProperty被解释为StringProperty

时间:2010-08-08 11:11:49

标签: google-app-engine google-cloud-datastore bigtable data-import

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) 

一切似乎都很好,但是当我上传时我收到此错误: BadValueError: Property data is 24788 bytes long; it must be 500 or less. Consider Text instead, which can store strings of any length.

出于某种原因,它认为数据是字符串属性。

任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:9)

您需要为文本字段指定导入转换,如下所示:

- property: data
  external_name: data
  import_transform: db.Text