Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: string indices must be integers when calling add_dashboard_panel #192

Open
victoria-miltcheva opened this issue May 21, 2021 · 1 comment

Comments

@victoria-miltcheva
Copy link

victoria-miltcheva commented May 21, 2021

Hi there,

I'm attempting to add a dashboard panel to a newly-created dashboard when running this script, but I get the following error:

  File "/Users/<REDACTED>/.pyenv/versions/3.8.5/lib/python3.8/site-packages/sdcclient/monitor/_dashboards_v3.py", line 169, in add_dashboard_panel
    new_panel_id = dboard["panels"][-1]["id"] + 1
TypeError: string indices must be integers

It occurs on this line. I can confirm that my local configuration (API key, endpoint URL, instance ID) is correct since I haven't had any issues executing other functions from this SDK.

@victoria-miltcheva victoria-miltcheva changed the title I get a TypeError: string indices must be integers when calling add_dashboard_panel TypeError: string indices must be integers when calling add_dashboard_panel May 21, 2021
@victoria-miltcheva
Copy link
Author

victoria-miltcheva commented May 21, 2021

I noticed I get a similar error on line 46 of dashboard_save_load.py.

  File "/Users/<REDACTED>/.pyenv/versions/3.8.5/lib/python3.8/site-packages/sdcclient/monitor/_dashboards_v3.py", line 381, in create_dashboard_from_file
    return self.create_dashboard_from_template(dashboard_name, dashboard, filter, shared, public)
  File "/Users/<REDACTED>/.pyenv/versions/3.8.5/lib/python3.8/site-packages/sdcclient/monitor/_dashboards_v3.py", line 271, in create_dashboard_from_template
    template['id'] = None
TypeError: list indices must be integers or slices, not str

For context, I'm running Python 3.8.5 on a macOS Big Sur Version 11.3.1. I'm also using version 0.16.0 of the sdcclient.

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

No branches or pull requests

1 participant