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

Type error when getting a dashboard #920

Open
larryenvacances opened this issue Mar 29, 2022 · 13 comments
Open

Type error when getting a dashboard #920

larryenvacances opened this issue Mar 29, 2022 · 13 comments

Comments

@larryenvacances
Copy link

Describe the bug
When trying to retrieve a dashboard by using the call dashboards_api.get_dashboard(dashboard.get("id")), I get an error saying datadog_api_client.v1.exceptions.ApiTypeError: Invalid type for variable 'x'. Required value type is int and passed type was float at ['received_data']['widgets'][15]['layout']['x']

To Reproduce
Steps to reproduce the behavior:

  1. Have a dashboard that has and X value that is a float and not an int
  2. Call get_dashboard for said dashboard
  3. See error

Expected behavior
The dashboard is returned with the float value for X

Environment and Versions (please complete the following information):

  • Windows 10
  • Python 3.10
  • api client v1
@anapernalete
Copy link

Hey there, reporting on the same issue, I am receiving a similar error with the monitor API. This seems to be specific to version 1.10.0.

A few observations:

  1. This triggered when I didn't provide pagination parameters for list_monitors
  2. When using get_monitor random ID's would not work, but some would. Seemed to be no specific pattern
  3. When giving an id_offset to list_monitors API call, it would also randomly error on specific ID's with a similar error above

If I roll back to 1.9: pip install datadog-api-client==1.9.0, this seems to fix the problem, so seems like a bug in the version 1.10 release.

Environment and Versions (please complete the following information):

Mac OS Monterey
Python 3.9
api client v1, v1.10

@therve
Copy link
Contributor

therve commented Mar 30, 2022

Hi,

Regarding the dashboard bug, it's a difference between the OpenAPI spec and old backend behavior. Obviously float X doesn't make sense, but it was still stored this way.

The monitor issue is completely different. It might be because of additional validation introduced in 1.10. Can you open a different issue? Thanks.

@larryenvacances
Copy link
Author

larryenvacances commented Mar 30, 2022

@therve thanks for the quick answer. do you have any hint on when that bug could be fixed or if there is a way we could mitigate on our side? I see the implementation isn't done in the v2 of the API yet.

I worked around the issue by using the http REST endpoint, but I would rather use the client so that I have the Model type of the dashboard returned to me.

@therve
Copy link
Contributor

therve commented Mar 31, 2022

A quick workaround would be to update the dashboard to only have have integers for x and y attributes.

@github-actions
Copy link

github-actions bot commented May 1, 2022

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

@github-actions github-actions bot added the stale label May 1, 2022
@valfa14
Copy link

valfa14 commented May 31, 2022

Hey, Any plans to fix it? We hot-fixed it with local retyping float to int here https://github.com/DataDog/datadog-api-client-python/blob/master/src/datadog_api_client/v1/model/widget_layout.py#L85-L86
We want to fix corrupted (by manual interaction) dashboards automatically, but it is not doable as those manual changes break the loading via your module.

@github-actions github-actions bot removed the stale label Jun 1, 2022
@github-actions
Copy link

github-actions bot commented Jul 1, 2022

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

@zepeng811
Copy link

This is still an issue with the latest version 2.5.0, any plan on fixing this issue soon?

@therve
Copy link
Contributor

therve commented Oct 26, 2022

Is it happening on a recent dashboard? Otherwise just editing the dashboard and saving it should fix it. Please contact support so that we can see the problematic dashboard. Thanks.

@zepeng811
Copy link

Is it happening on a recent dashboard? Otherwise just editing the dashboard and saving it should fix it. Please contact support so that we can see the problematic dashboard. Thanks.

@therve Thanks for the reply! It was probably old dashboards, the problem was some of the widgets have x or y coordinate as floats, I managed to fix it by manually editing those dashboards resizing those individual widgets which the new coordinates are integers, not the most efficient solution but it got the work done.

@github-actions github-actions bot removed the stale label Oct 27, 2022
@github-actions
Copy link

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

@github-actions github-actions bot added the stale label Nov 27, 2022
@edkorthof
Copy link

We see this when using dashboards where we've edited the location of the widgets. It's possible that I could resolve it by editing every widget, but simply editing the console and saving it doesn't cause the widgets to snap to integer locations.

Would you consider a PR to accept floats like this?

@github-actions github-actions bot removed the stale label Aug 22, 2024
Copy link

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community.

If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

@github-actions github-actions bot added the stale label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants