Skip to content

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
@max-melentyev max-melentyev deleted the patch-1 branch January 21, 2025 16:22
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