12
12
logger = logging .getLogger (__name__ )
13
13
14
14
15
- @dataclass
16
- class Record :
17
- workspace_id : int # The workspace id
18
- run_id : int # The workflow run id that crawled the objects
19
- run_start_time : dt .datetime # The workflow run timestamp that crawled the objects
20
- object_type : str # The object type, e.g. TABLE, VIEW. Forms a composite key together with object_id
21
- object_id : str # The object id, e.g. hive_metastore.database.table. Forms a composite key together with object_id
22
- object_data : str # The object data; the attributes of the corresponding ucx data class, e.g. table name, table ...
23
- failures : list [str ] # The failures indicating the object is not UC compatible
24
- owner : str # The object owner
25
- ucx_version : str # The ucx semantic version
26
- snapshot_id : int # An identifier for the snapshot
15
+ @dataclass (frozen = True , kw_only = True )
16
+ class HistoricalRecord :
17
+ workspace_id : int
18
+ """The identifier of the workspace where this record was generated."""
19
+
20
+ run_id : int
21
+ """An identifier of the workflow run that generated this record."""
22
+
23
+ snapshot_id : int
24
+ """An identifier that is unique to the records produced for a given snapshot."""
25
+
26
+ run_start_time : dt .datetime
27
+ """When this record was generated."""
28
+
29
+ object_type : str
30
+ """The inventory table for which this record was generated."""
31
+
32
+ object_type_version : int
33
+ """Versioning of inventory table, for forward compatibility."""
34
+
35
+ object_id : list [str ]
36
+ """The type-specific identifier for this inventory record."""
37
+
38
+ object_data : str
39
+ """Type-specific JSON-encoded data of the inventory record."""
40
+
41
+ object_owner : str
42
+ """The identity that has ownership of the object."""
43
+
44
+ failures : list [str ]
45
+ """The list of problems associated with the object that this inventory record covers."""
27
46
28
47
29
48
class HistoryInstallation :
@@ -40,7 +59,7 @@ def __init__(self, sql_backend: SqlBackend, ucx_catalog: str) -> None:
40
59
41
60
def run (self ) -> None :
42
61
self ._create_schema ()
43
- self ._create_table ("records" , Record )
62
+ self ._create_table ("records" , HistoricalRecord )
44
63
logger .info ("Installation completed successfully!" )
45
64
46
65
@retried (on = [InternalError ], timeout = dt .timedelta (minutes = 1 ))
0 commit comments