You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can generate JSON for a dashboard with a BarGauge panel with orientation set to auto.
What happened?
Attempting to create a BarGauge panel with orientation="auto" raises an exception when running the dashboard code through generate-dashboard
Traceback (most recent call last):
File "/Users/jwalgran/.pyenv/versions/3.8.10/bin/generate-dashboard", line 8, in <module>
sys.exit(generate_dashboard_script())
File "/Users/jwalgran/.pyenv/versions/3.8.10/lib/python3.8/site-packages/grafanalib/_gen.py", line 242, in generate_dashboard_script
run_script(generate_dashboard)
File "/Users/jwalgran/.pyenv/versions/3.8.10/lib/python3.8/site-packages/grafanalib/_gen.py", line 80, in run_script
sys.exit(f(sys.argv[1:]))
File "/Users/jwalgran/.pyenv/versions/3.8.10/lib/python3.8/site-packages/grafanalib/_gen.py", line 223, in generate_dashboard
dashboard = loader(opts.dashboard)
File "/Users/jwalgran/.pyenv/versions/3.8.10/lib/python3.8/site-packages/grafanalib/_gen.py", line 60, in loader
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/jwalgran/Downloads/bargauge_auto_example.dashboard.py", line 6, in <module>
BarGauge(orientation="auto"),
File "<attrs generated init grafanalib.core.BarGauge>", line 76, in __init__
File "/Users/jwalgran/.pyenv/versions/3.8.10/lib/python3.8/site-packages/attr/validators.py", line 307, in __call__
raise ValueError(
ValueError: ("'orientation' must be in ['horizontal', 'vertical'] (got 'auto')", Attribute(name='orientation', default='horizontal', validator=<in_ validator with options ['horizontal', 'vertical']>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None, alias='orientation'), ['horizontal', 'vertical'], 'auto')
What you expected to happen?
I can generate JSON for a dashboard with a
BarGauge
panel with orientation set to auto.What happened?
Attempting to create a
BarGauge
panel withorientation="auto"
raises an exception when running the dashboard code throughgenerate-dashboard
How to reproduce it?
Create bargauge_auto_example.dashboard.py
Attempt to generate JSON
generate-dashboard bargauge_auto_example.dashboard.py > bargauge_auto_example.dashboard.json
Additional context
Definition of the
BarGauge.orientation
attribute is heregrafanalib/grafanalib/core.py
Lines 3372 to 3375 in c82a679
The documentation for
BarGauge
listauto
as a valid optionhttps://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/bar-gauge/#orientation
The text was updated successfully, but these errors were encountered: