Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 在App Engine bulkuploader yaml中使用post_导入_功能_Google App Engine_Google Cloud Datastore_Bulkloader - Fatal编程技术网

Google app engine 在App Engine bulkuploader yaml中使用post_导入_功能

Google app engine 在App Engine bulkuploader yaml中使用post_导入_功能,google-app-engine,google-cloud-datastore,bulkloader,Google App Engine,Google Cloud Datastore,Bulkloader,我正在尝试使用bulkuploader将一些数据上传到我的应用程序引擎数据存储。对于我的一种实体类型,我有一个从另一个实体计算出来的属性,所以我真的希望在导入每个实体进行计算时对其进行一些后处理。我一直看到关于post_import_function transform标记的简短提及,但没有真正全面的文档或示例 现在,我只是想做一个简单的测试,让我的post_import_函数正常工作 我的实体模型: class TestEntity(db.Model): location = db.G

我正在尝试使用bulkuploader将一些数据上传到我的应用程序引擎数据存储。对于我的一种实体类型,我有一个从另一个实体计算出来的属性,所以我真的希望在导入每个实体进行计算时对其进行一些后处理。我一直看到关于post_import_function transform标记的简短提及,但没有真正全面的文档或示例

现在,我只是想做一个简单的测试,让我的post_import_函数正常工作

我的实体模型:

class TestEntity(db.Model):
    location = db.GeoPtProperty()
    cells = db.StringListProperty() # Computed from location
my bulkloader.yaml文件的相关部分如下所示:

- kind: TestEntity
  [... connector info ...]
  property_map:
    [... transform info for __key__ and location here ...]
  post_import_function: post_transform.post_process_testentity
以及我的后期处理测试功能:

def post_process_testentity(input_dict, entity_instance, bulkload_state):
    entity_instance.cells = [u'Hello there!']
    return entity_instance
当我用这些东西上传数据时,我没有收到任何错误(我知道正在输入post_process_testentity,因为我在其中添加了一些正确运行的打印语句)。关于上传的一切工作,除了我的后期处理功能绝对没有效果。当我使用data viewer时,我的数据存储中没有“你好!”


谁能帮我一点忙吗?谢谢大家!

如果其他人也有类似的问题,我会按照上面的说明进行测试。似乎后处理函数中的
entity\u实例
实际上是
google.appengine.api.datastore.entity
,它是
dict
的子类。因此,对post_process_testentity函数的修改起到了作用:

def post_process_testentity(input_dict, entity_instance, bulkload_state):
    entity_instance['cells'] = [u'Hello there!']
    return entity_instance

然而,我只是通过打印各种调试消息来解决这个问题。如果这些东西被记录在案那就太好了。有人知道我在哪里可以找到这样的文档吗?

如果其他人也有类似的问题,我会按照上面的描述进行测试。似乎后处理函数中的
entity\u实例
实际上是
google.appengine.api.datastore.entity
,它是
dict
的子类。因此,对post_process_testentity函数的修改起到了作用:

def post_process_testentity(input_dict, entity_instance, bulkload_state):
    entity_instance['cells'] = [u'Hello there!']
    return entity_instance
然而,我只是通过打印各种调试消息来解决这个问题。如果这些东西被记录在案那就太好了。有人知道我在哪里可以找到这样的文档吗