我创建了以下批量加载程序,并且可以成功下载数据。
- kind: EmailRegistration
connector: csv
connector_options:
property_map:
- property: __key__
external_name: key
export_transform: transform.key_id_or_name_as_string
- property: auth_provider
external_name: auth_provider
# Type: Key Stats: 6 properties of this type in this kind.
import_transform: transform.create_foreign_key('AuthProvider', key_is_id=True)
export_transform: transform.key_id_or_name_as_string
- property: code
external_name: code
# Type: String Stats: 6 properties of this type in this kind.
- property: email
external_name: email
# Type: String Stats: 6 properties of this type in this kind.
- property: is_user_combined
external_name: is_user_combined
# Type: Boolean Stats: 6 properties of this type in this kind.
import_transform: transform.regexp_bool('true', re.IGNORECASE)
- property: name
external_name: name
# Type: String Stats: 6 properties of this type in this kind.
下载的csv的一行:
code is_user_combined name auth_provider key email
57H8qSAcvS True Mr Sharma em|xxxx@gmail.com 57H8qSAcvS xxxx@gmail.com
在不更改数据中的任何内容的情况下,当我尝试将其上传回来时,出现以下异常:
Traceback (most recent call last):
File "/home/kave/workspace/google_appengine/google/appengine/tools/adaptive_thread_pool.py", line 175, in WorkOnItems
status, instruction = item.PerformWork(self.__thread_pool)
File "/home/kave/workspace/google_appengine/google/appengine/tools/bulkloader.py", line 767, in PerformWork
transfer_time = self._TransferItem(thread_pool)
File "/home/kave/workspace/google_appengine/google/appengine/tools/bulkloader.py", line 936, in _TransferItem
self.content = self.request_manager.EncodeContent(self.rows)
File "/home/kave/workspace/google_appengine/google/appengine/tools/bulkloader.py", line 1416, in EncodeContent
entity = loader.create_entity(values, key_name=key, parent=parent)
File "/home/kave/workspace/google_appengine/google/appengine/ext/bulkload/bulkloader_config.py", line 456, in create_entity
entity = self.dict_to_entity(input_dict, self.bulkload_state)
File "/home/kave/workspace/google_appengine/google/appengine/ext/bulkload/bulkloader_config.py", line 147, in dict_to_entity
self.__run_import_transforms(input_dict, instance, bulkload_state_copy)
File "/home/kave/workspace/google_appengine/google/appengine/ext/bulkload/bulkloader_config.py", line 259, in __run_import_transforms
value = self.__dict_to_prop(transform, input_dict, bulkload_state)
File "/home/kave/workspace/google_appengine/google/appengine/ext/bulkload/bulkloader_config.py", line 207, in __dict_to_prop
value = transform.import_transform(value)
File "/home/kave/workspace/google_appengine/google/appengine/ext/bulkload/bulkloader_parser.py", line 111, in __call__
return self.method(*args, **kwargs)
File "/home/kave/workspace/google_appengine/google/appengine/ext/bulkload/transform.py", line 127, in generate_foreign_key_lambda
value = int(value)
ValueError: invalid literal for int() with base 10: 'em|xxxx@gmail.com'
[INFO ] [WorkerThread-1] Backing off due to errors: 1.0 seconds
[INFO ] An error occurred. Shutting down...
[ERROR ] Error in WorkerThread-0: invalid literal for int() with base 10: 'em|xxxx@gmail.com'
我必须改变什么?非常感谢