开发者

Python Appengine Mapreduce gives Bad Entity Kind on run

开发者 https://www.devze.com 2023-03-01 00:39 出处:网络
I\'ve been struggling with this for hours... In my project, I have my models.py defined in folder \"project\", under the main root.I also have the mapreduce files in folder \"mapreduce\", inside the

I've been struggling with this for hours...

In my project, I have my models.py defined in folder "project", under the main root. I also have the mapreduce files in folder "mapreduce", inside the "project" folder. Files system looks like:

Main Root

-P开发者_如何转开发roject folder

-> models.py

-> Mapreduce folder

I have the mapreduce.yaml file defined as:

mapreduce:
- name: Advice_Hidden
  mapper:
    input_reader: mapreduce.input_readers.DatastoreInputReader
    handler: mapreduce.main_map_handler.add_hidden
    params:
    - name: entity_kind
      default: project.models.Advice

But when I try to run mapreduce, I get the error:

BadReaderParamsError: Bad entity kind: Could not find 'models' on path 'advice'

Can anyone help me out? Should also note that I'm using Django-Piston as well.


Same issue here, re-arranging works, but I can't now rearrange my folder structure. In my case, I have a _init_.py under the "projects" directory. Also tried to add a _init_.py under the root directory where app.yaml and mapreduce.yaml reside (to no avail)

Strangely, my error is different. Using your example, it would be

  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/mapreduce/input_readers.py", line 660, in validate
    raise BadReaderParamsError("Bad entity kind: %s" % e)
BadReaderParamsError: Bad entity kind: **Could not find 'models' on path 'project'**

Actually, just found out that in production it works, that is, the root directory (where app .yaml resides) is in sys.path. In the sdk it isn't. Need to find out why. Investigating.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号