mingrammer / diagrams

:art: Diagram as Code for prototyping cloud system architectures
https://diagrams.mingrammer.com
MIT License
37.47k stars 2.44k forks source link

Example failure - Edges #442

Open forestrick opened 3 years ago

forestrick commented 3 years ago

Ref: https://diagrams.mingrammer.com/docs/guides/edge

I try to copy the code and test run it then I kept seeing errors like,

Traceback (most recent call last):
  File "/Users/rick/python/arch-graph/arch-graph.py", line 7, in <module>
    from diagrams.onprem.logging import Fluentd
ImportError: cannot import name 'Fluentd' from 'diagrams.onprem.logging' (/usr/local/lib/python3.9/site-packages/diagrams/onprem/logging.py)

Which I found the problems was the demo code tries to import Fluentd from the path diagrams.onprem.logging,

from diagrams.onprem.logging import Fluentd

then I tried to find the Fluentd in folder /usr/local/lib/python3.9/site-packages/diagrams and saw Fluentd is in aggregator.py so I modified the demo code to

from diagrams.onprem.aggregator import Fluentd

then it works perfectly.

Not sure you if meant to move Fluentd to aggregator.py, if so, the demo code should be modified accordingly. Thanks.

gabriel-tessier commented 3 years ago

@forestrick

Thank you for reporting the error, the example was updated in the following commit: https://github.com/mingrammer/diagrams/commit/54a26048f7348e7de5cf89bbeafb616202a78542

But the last version don't have the changes yet.