Skip to content

allow passing additional options to graphviz, fix #332#377

Merged
martindurant merged 4 commits intopython-streamz:masterfrom
badiku:graphviz_options
Nov 13, 2020
Merged

allow passing additional options to graphviz, fix #332#377
martindurant merged 4 commits intopython-streamz:masterfrom
badiku:graphviz_options

Conversation

@badiku
Copy link
Copy Markdown
Contributor

@badiku badiku commented Nov 6, 2020

allow passing additional options to graphviz, fix #332

@martindurant
Copy link
Copy Markdown
Member

martindurant commented Nov 6, 2020

Unfortunately, this breaks current usage (see the test failure), where the passed kwarg was expected to be already graph_attr. To allow both old and new usage, you could see if any of the top-level kwargs are in the passed dict,
{'name',
'comment',
'filename',
'directory',
'format',
'engine',
'encoding',
'graph_attr',
'node_attr',
'edge_attr',
'body',
'strict'}
and if not, set
graph_attr = {'graph_attr': graph_attr}.
I would use set intersection to see if there are any top-level keys.

@badiku
Copy link
Copy Markdown
Contributor Author

badiku commented Nov 7, 2020

streamz/tests/test_kafka.py::test_kafka_checkpointing_auto_offset_reset_latest FAILED [ 99%]

test_kafka_checkpointing_auto_offset_reset_latest faild? don't know why.

def launch_kafka():
   ...
   wait_for(predicate, 10, period=0.1)
   ...

streamz/tests/test_kafka.py:592: 
wait_for(lambda: len(out1) == 3 and (len(out1[0]) + len(out1[1]) + len(out1[2])) == 30, 10, 0.1)

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
predicate = <function test_kafka_checkpointing_auto_offset_reset_latest.<locals>.<lambda> at 0x7f4fb8b33670>
timeout = 10, fail_func = 0.1, period = 0.001
    def wait_for(predicate, timeout, fail_func=None, period=0.001):
        """Wait for predicate to turn true, or fail this test"""
        # from distributed.utils_test
        deadline = time() + timeout
        while not predicate():
            sleep(period)
            if time() > deadline:  # pragma: no cover
                if fail_func is not None:
>                   fail_func()
E                   TypeError: 'float' object is not callable
streamz/utils_test.py:115: TypeError

so some code at streamz/tests/test_kafka.py:592 send wrong arguments to wait_for function,
fail_func got float 0.1 but should be callable?

but I did not touch this kafka part.

@martindurant
Copy link
Copy Markdown
Member

Try to just run it again (push an empty commit if you have to). The kafka tests have sometimes become flaky, but we don't know why.

@martindurant martindurant merged commit a6e9111 into python-streamz:master Nov 13, 2020
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.

How to pass additional style and color options to graphviz?

2 participants