Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ classifiers = [
# also update fallback dependencies in workflow installer when changing dependencies!
dependencies = [
"databricks-labs-blueprint>=0.9.1,<0.10",
"databricks-sdk~=0.71",
"databricks-labs-lsql>=0.5,<=0.16",
"databricks-sdk~=0.73",
"sqlalchemy>=2.0,<3.0",
"PyYAML~=6.0.3",
Comment thread
mwojtyczka marked this conversation as resolved.
]

[project.optional-dependencies]
Expand Down Expand Up @@ -111,7 +111,7 @@ dependencies = [
"pytest-xdist~=3.5.0",
"pytest-benchmark~=5.1.0",
"ruff~=0.3.4",
"types-PyYAML~=6.0.12",
"types-PyYAML~=6.0.3",
Comment thread
mwojtyczka marked this conversation as resolved.
"types-requests~=2.31.0",
"databricks-connect~=15.4",
"pyspark~=3.5.0",
Expand Down
208 changes: 208 additions & 0 deletions src/databricks/labs/dqx/dashboards/dashboard.lvdash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
{
"datasets": [
{
"name": "00_1_dq_summary",
"displayName": "00_1_dq_summary",
"queryLines": [
"/* --title 'Data Quality Summary' */\n",
"SELECT \n",
" CASE\n",
" WHEN _errors IS NOT NULL THEN 'Errors'\n",
" WHEN _warnings IS NOT NULL THEN 'Warnings'\n",
" END AS category,\n",
" ROUND((COUNT(*) * 100.0 / (SELECT COUNT(*) FROM $catalog.schema.table)), 2) AS percentage\n",
"FROM $catalog.schema.table\n",
"GROUP BY category"
]
},
{
"name": "00_2_dq_error_types",
"displayName": "00_2_dq_error_types",
"queryLines": [
"/* --title 'Error and Warning Types Breakdown' */\n",
"WITH error_types AS (\n",
" SELECT\n",
" 'Error' AS category,\n",
" error_struct.name AS type,\n",
" COUNT(*) AS count\n",
" FROM $catalog.schema.table\n",
" LATERAL VIEW EXPLODE(_errors) exploded_errors AS error_struct\n",
" WHERE _errors IS NOT NULL\n",
" GROUP BY error_struct.name\n",
"),\n",
"warning_types AS (\n",
" SELECT\n",
" 'Warning' AS category,\n",
" warning_struct.name AS type,\n",
" COUNT(*) AS count\n",
" FROM $catalog.schema.table\n",
" LATERAL VIEW EXPLODE(_warnings) exploded_warnings AS warning_struct\n",
" WHERE _warnings IS NOT NULL\n",
" GROUP BY warning_struct.name\n",
"),\n",
"combined AS (\n",
" SELECT * FROM error_types\n",
" UNION ALL\n",
" SELECT * FROM warning_types\n",
"),\n",
"total AS (\n",
" SELECT SUM(count) AS total_count FROM combined\n",
")\n",
"SELECT\n",
" category,\n",
" type,\n",
" count,\n",
" ROUND((count * 100.0) / total.total_count, 2) AS percentage\n",
"FROM combined, total\n",
"ORDER BY category, count DESC;"
]
}
],
"pages": [
{
"name": "DQX_Quality_Dashboard",
"displayName": "DQX_Quality_Dashboard",
"layout": [
{
"widget": {
"name": "00_1_dq_summary_widget",
"queries": [
{
"name": "main_query",
"query": {
"datasetName": "00_1_dq_summary",
"fields": [
{
"name": "sum(percentage)",
"expression": "SUM(`percentage`)"
},
{
"name": "category",
"expression": "`category`"
}
],
"disaggregated": false
}
}
],
"spec": {
"version": 3,
"widgetType": "pie",
"encodings": {
"angle": {
"displayName": "Total Row Counts",
"fieldName": "sum(percentage)",
"scale": {
"type": "quantitative"
}
},
"color": {
"displayName": "category",
"fieldName": "category",
"scale": {
"type": "categorical",
"mappings": [
{
"color": "#00A972"
},
{
"color": "#FFAB00"
},
{
Comment thread
mwojtyczka marked this conversation as resolved.
"color": "#FF3621"
}
]
}
},
"label": {
"show": true
}
},
"frame": {
"description": "",
"showDescription": false,
"showTitle": true,
"title": "Data Quality Summary"
}
}
},
"position": {
"x": 0,
"y": 0,
"width": 3,
"height": 6
}
},
{
"widget": {
"name": "00_2_dq_error_types_widget",
"queries": [
{
"name": "main_query",
"query": {
"datasetName": "00_2_dq_error_types",
"fields": [
{
"name": "Category",
"expression": "`category`"
},
{
"name": "Type",
"expression": "`type`"
},
{
"name": "Count",
"expression": "`count`"
},
{
"name": "Percentage",
"expression": "`percentage`"
}
],
"disaggregated": true
}
}
],
"spec": {
"version": 2,
"widgetType": "table",
"encodings": {
"columns": [
{
"displayName": "Category",
"fieldName": "Category"
},
{
"displayName": "Type",
"fieldName": "Type"
},
{
"displayName": "Count",
"fieldName": "Count"
},
{
"displayName": "Percentage (%)",
"fieldName": "Percentage"
}
]
},
"frame": {
"description": "",
"showDescription": false,
"showTitle": true,
"title": "Error and Warning Types Breakdown"
}
}
},
"position": {
"x": 3,
"y": 0,
"width": 3,
"height": 6
}
}
],
"pageType": "PAGE_TYPE_CANVAS"
}
]
}
Loading
Loading