douban / dpark

Python clone of Spark, a MapReduce alike framework in Python
BSD 3-Clause "New" or "Revised" License
2.69k stars 534 forks source link

broadcast用法有变? #28

Closed muxueqz closed 11 years ago

muxueqz commented 11 years ago
import dpark
bcast_test = dpark.broadcast(1)
bcast_2 = dpark.broadcast(2)

以前的版本是可以的,现在的版本会报:

Traceback (most recent call last):
  File "bcast_test.py", line 3, in <module>
    bcast_2 = dpark.broadcast(2)
TypeError: 'module' object is not callable

改为

import dpark
dpark_bcast = dpark.DparkContext()
bcast_test = dpark_bcast.broadcast(1)
bcast_2 = dpark_bcast.broadcast(2)

就OK

davies commented 11 years ago

因为 dpark.broadcast 有歧义, 可能是一个函数, 也可能是一个模块, 所以就把函数去掉了.

muxueqz commented 11 years ago

嗯,理解,对了,以后这种重大改变能不能加个Changelog中?git commit中的无关信息太多了。。。

davies commented 11 years ago

恩, 涉及到接口的改变, 确实应该注明比较好. 多谢提醒.

On Sun, Aug 4, 2013 at 12:13 PM, muxueqz notifications@github.com wrote:

嗯,理解,对了,以后这种重大改变能不能加个Changelog中?git commit中的无关信息太多了。。。

— Reply to this email directly or view it on GitHubhttps://github.com/douban/dpark/issues/28#issuecomment-22066537 .

muxueqz commented 11 years ago

客气,看来最近文档也多了一点儿,可喜的变化^_^

2013/8/4 Davies Liu notifications@github.com

恩, 涉及到接口的改变, 确实应该注明比较好. 多谢提醒.

On Sun, Aug 4, 2013 at 12:13 PM, muxueqz notifications@github.com wrote:

嗯,理解,对了,以后这种重大改变能不能加个Changelog中?git commit中的无关信息太多了。。。

— Reply to this email directly or view it on GitHub< https://github.com/douban/dpark/issues/28#issuecomment-22066537> .

  • Davies

— Reply to this email directly or view it on GitHubhttps://github.com/douban/dpark/issues/28#issuecomment-22066815 .

明源 http://muxueqz.laou.me Twitter: @muxueqz https://twitter.com/muxueqz

muxueqz commented 11 years ago

另外,就是

bcast_test = dpark.broadcast(1)
bcast_2 = dpark.broadcast(2)

第一个broadcast其实是正常用的,到第二个才报错,建议直接去掉

davies commented 11 years ago

内部的代码已经去掉了, 还没push.

On Sun, Aug 4, 2013 at 1:10 PM, muxueqz notifications@github.com wrote:

另外,就是

bcast_test = dpark.broadcast(1) bcast_2 = dpark.broadcast(2)

第一个broadcast其实是正常用的,到第二个才报错,建议直接去掉

— Reply to this email directly or view it on GitHubhttps://github.com/douban/dpark/issues/28#issuecomment-22066970 .