Skip to content

Conversation

@CJ-Wright
Copy link
Member

No description provided.

@codecov-io
Copy link

codecov-io commented May 7, 2019

Codecov Report

Merging #248 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #248   +/-   ##
=======================================
  Coverage   94.96%   94.96%           
=======================================
  Files          13       13           
  Lines        1609     1609           
=======================================
  Hits         1528     1528           
  Misses         81       81

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0dc970...b68c430. Read the comment docs.

@CJ-Wright
Copy link
Member Author

Ready for review!

Copy link
Member

@martindurant martindurant left a 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):
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping on this one

Copy link
Member Author

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!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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]
Copy link
Member

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))
Copy link
Member

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]
Copy link
Member

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"
Copy link
Member

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:
Copy link
Member

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.

@CJ-Wright
Copy link
Member Author

@martindurant since zip_latest is out of scope, can this get another round?

@martindurant martindurant merged commit f6f6e14 into python-streamz:master Jun 25, 2019
@CJ-Wright CJ-Wright deleted the add_upstream2 branch June 25, 2019 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants