File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
src/datahub/ingestion/source/grafana Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ class Dashboard(_GrafanaBaseModel):
6565 description : str = ""
6666 version : Optional [str ] = None
6767 panels : List [Panel ]
68- tags : List [str ]
68+ tags : List [str ] = Field ( default_factory = list )
6969 timezone : Optional [str ] = None
7070 refresh : Optional [str ] = None
7171 schema_version : Optional [str ] = Field (default = None , alias = "schemaVersion" )
Original file line number Diff line number Diff line change @@ -88,6 +88,27 @@ def test_dashboard_nested_panels():
8888 assert dashboard .panels [1 ].title == "Top Level Panel"
8989
9090
91+ def test_dashboard_without_tags ():
92+ """Test that dashboards without tags field validate correctly (default to empty list)"""
93+ dashboard_data = {
94+ "dashboard" : {
95+ "uid" : "dash1" ,
96+ "title" : "Test Dashboard" ,
97+ "description" : "Test Description" ,
98+ "version" : "1" ,
99+ "panels" : [],
100+ "timezone" : "utc" ,
101+ "schemaVersion" : "1.0" ,
102+ "meta" : {"folderId" : "123" },
103+ }
104+ }
105+
106+ dashboard = Dashboard .model_validate (dashboard_data )
107+ assert dashboard .uid == "dash1"
108+ assert dashboard .title == "Test Dashboard"
109+ assert dashboard .tags == []
110+
111+
91112def test_folder ():
92113 folder_data = {"id" : "1" , "title" : "Test Folder" , "description" : "Test Description" }
93114
You can’t perform that action at this time.
0 commit comments