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

The "mappings" values in the Panel object belong under "fieldConfig" -> "defaults" not as a key of the Panel #573

Open
grantsohn opened this issue Mar 1, 2023 · 0 comments

Comments

@grantsohn
Copy link

grantsohn commented Mar 1, 2023

Look at https://play.grafana.org/d/000000012/grafana-play-home?orgId=1# and then download or view the dashboard as JSON.

    {
      "datasource": {
        ...
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            ...
          },
          "mappings": [],
          "thresholds": {
            ...
          },
          "unit": "short"
        },
        "overrides": [
          ...
        ]
      },

Search for "mappings". You will see that "mappings" belongs to "fieldConfig" -> "defaults" but your code https://github.com/weaveworks/grafanalib/blob/main/grafanalib/core.py#L3179 is placing "mappings" under the Panel dict. This is preventing the mappings from being rendered in the panel.

What you expected to happen?

mappings is supposed to work.

What happened?

mappings are not being applied to the panel.

How to reproduce it?

Download any dashboard and look for "mappings".

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