Skip to content

Commit

Permalink
IteratorNode should not take kwargs. The iterator should be passed as…
Browse files Browse the repository at this point in the history
… data
  • Loading branch information
JohnVinyard committed May 13, 2016
1 parent bd4a9c5 commit eb8d54d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion featureflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.6.9'
__version__ = '0.7.9'

from model import BaseModel

Expand Down
5 changes: 2 additions & 3 deletions featureflow/iteratornode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@


class IteratorNode(Node):
def __init__(self, iterable=None, needs=None):
self.iterable = iterable
def __init__(self, needs=None):
super(IteratorNode, self).__init__(needs=needs)

def _process(self, data):
for x in self.iterable:
for x in data:
yield x
2 changes: 1 addition & 1 deletion featureflow/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def test_can_use_iterator_node(self):
iterable = chunked(StringIO(data_source['mary']), chunksize=3)

class D(BaseModel, self.Settings):
stream = Feature(IteratorNode, iterable=iterable, store=True)
stream = Feature(IteratorNode, store=True)
words = Feature(Tokenizer, needs=stream, store=False)
count = JSONFeature(WordCount, needs=words, store=True)

Expand Down

0 comments on commit eb8d54d

Please sign in to comment.