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

Allow using non-row panels in dashboard's panels #684

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

max-melentyev
Copy link
Contributor

What does this do?

As discussed in grafana/grafana#50855 (comment), panels of rows with collapsed=False should be added to the list of panels that contains that row.

Adding non-row panels makes auto_panel_ids() fail with

  File ".../grafanalib/core.py", line 1751, in auto_panel_ids
    ids = set([panel.id for panel in self._iter_panels() if panel.id])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../grafanalib/core.py", line 1731, in _iter_panels
    for row_panel in panel._iter_panels():
                     ^^^^^^^^^^^^^^^^^^
AttributeError: 'TimeSeries' object has no attribute '_iter_panels'

This change fixes this exception.

As discussed in grafana/grafana#50855 (comment), panels of rows with collapsed=False should be added to the list of panels that contains that row.

Adding non-row panels makes auto_panel_ids() fail with
```
  File ".../grafanalib/core.py", line 1751, in auto_panel_ids
    ids = set([panel.id for panel in self._iter_panels() if panel.id])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../grafanalib/core.py", line 1731, in _iter_panels
    for row_panel in panel._iter_panels():
                     ^^^^^^^^^^^^^^^^^^
AttributeError: 'TimeSeries' object has no attribute '_iter_panels'
```

This change fixes this exception.
Copy link

@casibbald casibbald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@casibbald casibbald merged commit 3ed1a9c into weaveworks:main Jan 3, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants