使用Python BadValueError在Google App Engine中上传批量数据

时间:2012-04-30 11:35:50

标签: python google-app-engine csv uploading

上传包含大约1300条记录的文件时收到错误。麻烦的是我看不出哪条记录有错,甚至是什么字段。我在appspot.com的日志记录屏幕上没有得到相关信息,下面给出了错误输出。有没有办法找出哪条记录有问题而无需手动分解数据 - 一个cvs文件?

以下是错误日志:

[DEBUG    2012-04-30 12:27:03,932 bulkloader.py] [WorkerThread-9] [151-160] Transferred 10 entities in 1.2 seconds
[DEBUG    2012-04-30 12:27:03,933 adaptive_thread_pool.py] [WorkerThread-9] WorkerThread: exiting
[ERROR    2012-04-30 12:27:03,933 adaptive_thread_pool.py] Error in WorkerThread-8: tag should be a string; received None (a NoneType):
[DEBUG    2012-04-30 12:27:03,933 adaptive_thread_pool.py] Traceback (most recent call last):
  File "/local/scratch/btd1y09/google_appengine/google/appengine/tools/adaptive_thread_pool.py", line 176, in WorkOnItems
    status, instruction = item.PerformWork(self.__thread_pool)
  File "/local/scratch/btd1y09/google_appengine/google/appengine/tools/bulkloader.py", line 764, in PerformWork
    transfer_time = self._TransferItem(thread_pool)
  File "/local/scratch/btd1y09/google_appengine/google/appengine/tools/bulkloader.py", line 933, in _TransferItem
    self.content = self.request_manager.EncodeContent(self.rows)
  File "/local/scratch/btd1y09/google_appengine/google/appengine/tools/bulkloader.py", line 1394, in EncodeContent
    entity = loader.create_entity(values, key_name=key, parent=parent)
  File "/local/scratch/btd1y09/google_appengine/google/appengine/ext/bulkload/bulkloader_config.py", line 445, in create_entity
    entity = self.dict_to_entity(input_dict, self.bulkload_state)
  File "/local/scratch/btd1y09/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 "/local/scratch/btd1y09/google_appengine/google/appengine/ext/bulkload/bulkloader_config.py", line 252, in __run_import_transforms
    value = self.__dict_to_prop(transform, input_dict, bulkload_state)
  File "/local/scratch/btd1y09/google_appengine/google/appengine/ext/bulkload/bulkloader_config.py", line 207, in __dict_to_prop
    value = transform.import_transform(value)
  File "/local/scratch/btd1y09/google_appengine/google/appengine/ext/bulkload/bulkloader_parser.py", line 111, in __call__
    return self.method(*args, **kwargs)
  File "/local/scratch/btd1y09/google_appengine/google/appengine/api/datastore_types.py", line 802, in __init__
    ValidateString(tag, 'tag')
  File "/local/scratch/btd1y09/google_appengine/google/appengine/api/datastore_types.py", line 164, in ValidateString
    (name, value, typename(value)))
BadValueError: tag should be a string; received None (a NoneType):

[DEBUG    2012-04-30 12:27:03,964 bulkloader.py] Waiting for progress_thread to terminate...
[DEBUG    2012-04-30 12:27:03,975 bulkloader.py] [Thread-11] ProgressTrackerThread: exiting
[DEBUG    2012-04-30 12:27:03,979 bulkloader.py] ... done.
[INFO     2012-04-30 12:27:03,979 bulkloader.py] 1210 entities total, 0 previously transferred
[INFO     2012-04-30 12:27:03,979 bulkloader.py] 190 entities (323188 bytes) transferred in 4.5 seconds
[INFO     2012-04-30 12:27:03,979 bulkloader.py] Some entities not successfully transferred

我正在使用带有bulkloader.yaml的远程api。

由于

0 个答案:

没有答案