1
1
import logging
2
+ from dataclasses import dataclass
2
3
3
4
from databricks .labs .lsql .backends import SqlBackend
4
5
from databricks .labs .lsql .deployment import SchemaDeployer
6
+
7
+ from databricks .labs .ucx .__about__ import __version__
5
8
from databricks .labs .ucx .progress .workflow_runs import WorkflowRun
6
9
10
+
7
11
logger = logging .getLogger (__name__ )
8
12
9
13
14
+ @dataclass (frozen = True , kw_only = True )
15
+ class Historical :
16
+ workspace_id : int
17
+ """The identifier of the workspace where this historical record was generated."""
18
+
19
+ job_run_id : int
20
+ """The identifier of the job run that generated this historical record."""
21
+
22
+ object_type : str
23
+ """The inventory table for which this historical record was generated."""
24
+
25
+ object_id : list [str ]
26
+ """The type-specific identifier for the corresponding inventory record."""
27
+
28
+ data : dict [str , str ]
29
+ """Type-specific JSON-encoded data of the inventory record."""
30
+
31
+ failures : list [str ]
32
+ """The list of problems associated with the object that this inventory record covers."""
33
+
34
+ owner : str
35
+ """The identity that has ownership of the object."""
36
+
37
+ ucx_version : str = __version__
38
+ """The UCX semantic version."""
39
+
40
+
10
41
class ProgressTrackingInstallation :
11
42
"""Install resources for UCX's progress tracking."""
12
43
@@ -19,4 +50,5 @@ def __init__(self, sql_backend: SqlBackend, ucx_catalog: str) -> None:
19
50
def run (self ) -> None :
20
51
self ._schema_deployer .deploy_schema ()
21
52
self ._schema_deployer .deploy_table ("workflow_runs" , WorkflowRun )
53
+ self ._schema_deployer .deploy_table ("historical" , Historical )
22
54
logger .info ("Installation completed successfully!" )
0 commit comments