feat: Enhance ID mapping service robustness, add defensive guards, and expand migration engine and API testing.
This commit is contained in:
@@ -101,11 +101,13 @@ class IdMappingService:
|
||||
|
||||
for res in resources:
|
||||
res_uuid = res.get("uuid")
|
||||
res_id = str(res.get("id")) # Store as string
|
||||
raw_id = res.get("id")
|
||||
res_name = res.get(name_field)
|
||||
|
||||
if not res_uuid or not res_id:
|
||||
if not res_uuid or raw_id is None:
|
||||
continue
|
||||
|
||||
res_id = str(raw_id) # Store as string
|
||||
|
||||
# Upsert Logic
|
||||
mapping = self.db.query(ResourceMapping).filter_by(
|
||||
|
||||
@@ -400,6 +400,8 @@ class SupersetClient:
|
||||
# @RETURN: Dict - Ответ API в случае успеха.
|
||||
def import_dashboard(self, file_name: Union[str, Path], dash_id: Optional[int] = None, dash_slug: Optional[str] = None) -> Dict:
|
||||
with belief_scope("import_dashboard"):
|
||||
if file_name is None:
|
||||
raise ValueError("file_name cannot be None")
|
||||
file_path = str(file_name)
|
||||
self._validate_import_file(file_path)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user