@@ -74,89 +74,5 @@ def workspace(self) -> Workspace:
7474 assert isinstance (self .parent , Folder )
7575 return self .parent .workspace
7676
77- def get_payload (self , definition , input_format = None ) -> dict :
78- match self .item_type :
79-
80- case ItemType .SPARK_JOB_DEFINITION :
81- return {
82- "type" : str (self .item_type ),
83- "description" : "Imported from fab" ,
84- "folderId" : self .folder_id ,
85- "displayName" : self .short_name ,
86- "definition" : {
87- "format" : (
88- "SparkJobDefinitionV1"
89- if input_format is None
90- else input_format
91- ),
92- "parts" : definition ["parts" ],
93- },
94- }
95- case ItemType .NOTEBOOK :
96- return {
97- "type" : str (self .item_type ),
98- "description" : "Imported from fab" ,
99- "folderId" : self .folder_id ,
100- "displayName" : self .short_name ,
101- "definition" : {
102- ** (
103- {"parts" : definition ["parts" ]}
104- if input_format == ".py"
105- else {"format" : "ipynb" , "parts" : definition ["parts" ]}
106- )
107- },
108- }
109- case ItemType .SEMANTIC_MODEL :
110- return {
111- "type" : str (self .item_type ),
112- "description" : "Imported from fab" ,
113- "folderId" : self .folder_id ,
114- "displayName" : self .short_name ,
115- "definition" : (
116- definition
117- if input_format is None
118- else {
119- "format" : input_format ,
120- "parts" : definition ["parts" ],
121- }
122- ),
123- }
124- case (
125- ItemType .REPORT
126- | ItemType .KQL_DASHBOARD
127- | ItemType .DATA_PIPELINE
128- | ItemType .KQL_QUERYSET
129- | ItemType .EVENTHOUSE
130- | ItemType .KQL_DATABASE
131- | ItemType .MIRRORED_DATABASE
132- | ItemType .DIGITAL_TWIN_BUILDER
133- | ItemType .REFLEX
134- | ItemType .EVENTSTREAM
135- | ItemType .MOUNTED_DATA_FACTORY
136- | ItemType .COPYJOB
137- | ItemType .VARIABLE_LIBRARY
138- | ItemType .GRAPHQLAPI
139- | ItemType .DATAFLOW
140- | ItemType .SQL_DATABASE
141- | ItemType .COSMOS_DB_DATABASE
142- | ItemType .GRAPH_QUERY_SET
143- | ItemType .USER_DATA_FUNCTION
144- | ItemType .MAP
145- ):
146- return {
147- "type" : str (self .item_type ),
148- "description" : "Imported from fab" ,
149- "folderId" : self .folder_id ,
150- "displayName" : self .short_name ,
151- "definition" : definition ,
152- }
153- case _:
154- raise FabricCLIError (
155- ErrorMessages .Hierarchy .item_type_doesnt_support_definition_payload (
156- str (self .item_type )
157- ),
158- fab_constant .ERROR_UNSUPPORTED_COMMAND ,
159- )
160-
16177 def get_folders (self ) -> List [str ]:
16278 return ItemFoldersMap .get (self .item_type , [])
0 commit comments