-
Notifications
You must be signed in to change notification settings - Fork 150
FIX: connect doesn't break zip now #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #248 +/- ##
=======================================
Coverage 94.96% 94.96%
=======================================
Files 13 13
Lines 1609 1609
=======================================
Hits 1528 1528
Misses 81 81Continue to review full report at Codecov.
|
|
Ready for review! |
martindurant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good tests.
| if downstream: | ||
| downstream._inform_asynchronous(asynchronous) | ||
|
|
||
| def _add_upstream(self, upstream): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this is internal API, I think one-line docstrings would be useful for developers.
Also, I suspect that the old way (self.upstream.downstreams.add/remove) is used in many places - do you think they ought to be changed to use this formalism now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the classes which use the old way should be migrated, otherwise they might run into issues with zip and such. I'll look to see if that pattern is used elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new slice method has it, sorry: https://github.com/python-streamz/streamz/blob/master/streamz/core.py#L795
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would appreciate if you merged from master and made sure that slice works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping on this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry about that, forgot it was there!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is taken care of now? https://github.com/python-streamz/streamz/pull/248/files#diff-d4e512993f47710ea9e7155d66011a24R813
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I am sorry - I don't know why I didn't see your commits come in.
streamz/core.py
Outdated
|
|
||
| def _add_upstream(self, upstream): | ||
| if self.upstreams == [None]: | ||
| self.upstreams = [upstream] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to make a new list, instead of self.upstreams[0] = upstream?
I suppose you were just copying how the code looked previously.
streamz/core.py
Outdated
| if len(self.upstreams) == 1: | ||
| self.upstreams = [None] | ||
| else: | ||
| self.upstreams.pop(self.upstreams.index(upstream)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.upstreams.remove(upstream)?
streamz/core.py
Outdated
|
|
||
| def _remove_upstream(self, upstream): | ||
| if len(self.upstreams) == 1: | ||
| self.upstreams = [None] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.upstreams[0] = None ?
streamz/core.py
Outdated
|
|
||
| def _remove_upstream(self, upstream): | ||
| if self.emit_on == upstream: | ||
| raise RuntimeError("Can't remove the emit on upstream, consider" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this message clearer?
streamz/core.py
Outdated
| def _add_upstream(self, upstream): | ||
| self.last.append(None) | ||
| self.missing.update([upstream]) | ||
| if self.emit_on != self.upstreams: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This equality check seems a little odd - can't we just store whether emit_on was originally given as None? Same comment for _remove_upstream.
|
@martindurant since |
No description provided.