Python Forum
TypeError: Diagram.render() takes 1 positional argument but 2 were given
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: Diagram.render() takes 1 positional argument but 2 were given
#1
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.
buran write Apr-30-2024, 07:19 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Better python library to create ER Diagram by using pandas data frames as tables klllmmm 0 1,195 Oct-19-2023, 01:01 PM
Last Post: klllmmm
  Error TypeError: output_type_handler() takes 2 positional arguments but 6 were given paulo79 1 1,982 Oct-17-2022, 06:29 PM
Last Post: paulo79
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 4,932 Jul-01-2022, 01:23 PM
Last Post: deanhystad
  Error: _vhstack_dispatcher() takes 1 positional argument but 9 were given alexfrol86 3 5,891 May-09-2022, 12:49 PM
Last Post: deanhystad
  What is positional argument self? Frankduc 22 5,886 Mar-06-2022, 01:18 AM
Last Post: Frankduc
  TypeError: missing a required argument: 'y' gible 0 2,954 Dec-15-2021, 02:21 AM
Last Post: gible
  positional argument: 'self' mcmxl22 8 3,396 Dec-13-2021, 10:11 PM
Last Post: deanhystad
  Generating classes diagram from source code Pavel_47 3 5,740 Oct-01-2021, 03:31 AM
Last Post: Lou
  TypeError: missing 3 required positional arguments: wardancer84 9 11,047 Aug-19-2021, 04:27 PM
Last Post: deanhystad
  TypeError: run_oracle_job() missing 1 required positional argument: 'connection_strin python_student 1 1,995 Aug-06-2021, 08:05 PM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020