Python Forum
TypeError: Diagram.render() takes 1 positional argument but 2 were given - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: TypeError: Diagram.render() takes 1 positional argument but 2 were given (/thread-42019.html)



TypeError: Diagram.render() takes 1 positional argument but 2 were given - sachin1361 - Apr-23-2024

I'm new to Python and used ChatGPT to generate a script that automatically creates a visual diagram after running terraform apply. The script (in diagramOriginal.py) aims to read the Terraform state file (tfstate) stored in S3+DynamoDB and use the Diagrams library to generate the diagram. However, I'm encountering an error, as below.

Error:
Traceback (most recent call last): │ File "C:\diagramOriginal.py", line 41, in <module> │ create_diagram_from_applied_state() │ File "C:\diagramOriginal.py", line 28, in create_diagram_from_applied_state │ diagram.render("arch1.png") │ TypeError: Diagram.render() takes 1 positional argument but 2 were given
I'm testing this locally on Windows 11.

I'd appreciate any help with debugging the error or if anyone has existing scripts for automatic cloud resource diagram generation. Ideally, I'd like to integrate this functionality into Azure Pipelines.