开发者

Using extended for cursor not working in Freebase Python API?

开发者 https://www.devze.com 2023-04-11 09:53 出处:网络
I\'ve been trying the freebase api and the followingquestion regarding setting up a cursor. I have the following code that does not work:

I've been trying the freebase api and the followingquestion regarding setting up a cursor.

I have the following code that does not work:

import freebase

def my_query():
    query = [{
        "name" : [],
        "type" : "/music/artist",
     开发者_开发百科   "/common/topic/image":[{}],
        "limit" : 10
        }]

    results = freebase.mqlreaditer(query, extended=True)
    for r in results:
        print r

if __name__ == "__main__":
    my_query()

I get the following error: TypeError: mqlreaditer() got an unexpected keyword argument 'extended'.

Am I missing something?


No, you're not missing something. Someone screwed up in doing the 1.0.8 release and made an incompatible change to the API, probably due to confusion with SVN branching.

If not don't need MQL extensions, just drop that parameter. If you need the functionality, you'll have to fall back to 1.0.6 until someone fixes the problem and does a new release.

 sudo easy_install freebase==1.0.6
0

精彩评论

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