Skip to content

Commit

Permalink
Add counters for migrated and pending migration data objects
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Oct 23, 2024
1 parent cc0753f commit 3428059
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* --title 'Pending migration' --description 'Total number of tables and views' --height 6 */
SELECT COUNT(*) AS count
FROM ucx_catalog.multiworkspace.latest_historical_per_workspace
WHERE object_type = "migration_status" AND SIZE(failures) > 0
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
--title 'Tables and views not migrated'
--title 'Pending migration'
--description 'Tables and views per owner'
--width 5
--overrides '{"spec": {
"version": 3,
"widgetType": "bar",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* --title 'Migrated' --description 'Total number of tables and views' --height 6 */
SELECT COUNT(*) AS count
FROM ucx_catalog.multiworkspace.latest_historical_per_workspace
WHERE object_type = "migration_status" AND SIZE(failures) == 0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* --title 'Tables and views migration completion (%)' --description 'Per owner' */
/* --title 'Overview' --description 'Tables and views migration' --width 5 */
WITH migration_statuses AS (
SELECT *
FROM ucx_catalog.multiworkspace.latest_historical_per_workspace
Expand Down
12 changes: 10 additions & 2 deletions tests/integration/queries/test_migration_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,19 @@ def test_migration_progress_dashboard(
("01_6_percentage_pipeline_migration_readiness", [Row(percentage=50.0)]),
("01_7_percentage_policy_migration_readiness", [Row(percentage=50.0)]),
(
"02_1_migration_status_by_owner_bar_graph",
"02_2_migrated_data_objects",
[Row(count=5)],
),
(
"02_2_pending_migration_data_objects",
[Row(count=5)],
),
(
"02_3_migration_status_by_owner_bar_graph",
[Row(owner="Andrew", count=1), Row(owner="Cor", count=4)],
),
(
"02_2_migration_status_by_owner_overview",
"02_4_migration_status_by_owner_overview",
[
Row(owner="Andrew", percentage=50.0, total=2, total_migrated=1, total_not_migrated=1),
Row(owner="Cor", percentage=42.857142857142854, total=7, total_migrated=3, total_not_migrated=4),
Expand Down

0 comments on commit 3428059

Please sign in to comment.