File tree 1 file changed +36
-0
lines changed
src/databricks/labs/remorph/reconcile/metadata
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ from dataclasses import dataclass , field
2
+ from typing import Any
3
+
4
+
5
+ @dataclass
6
+ class TableFQN :
7
+ catalog : str | None
8
+ schema : str
9
+ name : str
10
+
11
+ @property
12
+ def fqn (self ) -> str :
13
+ if self .catalog :
14
+ return f"{ self .catalog } .{ self .schema } .{ self .name } "
15
+ else :
16
+ return f"{ self .schema } .{ self .name } "
17
+
18
+
19
+ @dataclass
20
+ class FieldInfo :
21
+ name : str
22
+ data_type : str
23
+ nullable : bool | None = None
24
+ metadata : dict [str , Any ] | None = None
25
+
26
+
27
+ @dataclass
28
+ class TableDefinition :
29
+ fqn : TableFQN
30
+ location : str | None = None
31
+ table_format : str | None = None
32
+ view_text : str | None = None
33
+ columns : list [FieldInfo ] = field (default_factory = list )
34
+ primary_keys : list [str ] | None = None
35
+ size_gb : int = 0
36
+ comment : str | None = None
You can’t perform that action at this time.
0 commit comments