Skip to content
Snippets Groups Projects
Commit a5eb1dee authored by Leah Tacke genannt Unterberg's avatar Leah Tacke genannt Unterberg
Browse files

aligned related objects to superset import

parent 257f698b
Branches
No related tags found
No related merge requests found
...@@ -10,19 +10,21 @@ class MitMDatasetIdentifier(BaseSupersetDefinition): ...@@ -10,19 +10,21 @@ class MitMDatasetIdentifier(BaseSupersetDefinition):
uuid: StrUUID | None = None uuid: StrUUID | None = None
class RelatedTable(BaseSupersetDefinition): class RelatedObjectIdentifier(BaseSupersetDefinition):
table_id: SupersetId | None = None id: SupersetId | None = None
table_uuid: StrUUID uuid: StrUUID
class RelatedTable(RelatedObjectIdentifier):
pass
class RelatedSlice(BaseSupersetDefinition): class RelatedSlice(RelatedObjectIdentifier):
slice_id: SupersetId | None = None pass
slice_uuid: StrUUID
class RelatedDashboard(BaseSupersetDefinition): class RelatedDashboard(RelatedObjectIdentifier):
dashboard_id: SupersetId | None = None pass
dashboard_uuid: StrUUID
class SupersetMitMDatasetDef(SupersetDefFile): class SupersetMitMDatasetDef(SupersetDefFile):
......
...@@ -12,11 +12,11 @@ def mk_related_obj(kind: Literal['table', 'slice', 'dashboard'], ...@@ -12,11 +12,11 @@ def mk_related_obj(kind: Literal['table', 'slice', 'dashboard'],
uuid: UUID) -> RelatedTable | RelatedSlice | RelatedDashboard | None: uuid: UUID) -> RelatedTable | RelatedSlice | RelatedDashboard | None:
match kind: match kind:
case 'table': case 'table':
return RelatedTable(table_uuid=uuid) return RelatedTable(uuid=uuid)
case 'slice': case 'slice':
return RelatedSlice(slice_uuid=uuid) return RelatedSlice(uuid=uuid)
case 'dashboard': case 'dashboard':
return RelatedDashboard(dashboard_uuid=uuid) return RelatedDashboard(uuid=uuid)
def mk_related_objs(kind: Literal['table', 'slice', 'dashboard'], uuids: Iterable[UUID]) -> Iterable[RelatedTable] | \ def mk_related_objs(kind: Literal['table', 'slice', 'dashboard'], uuids: Iterable[UUID]) -> Iterable[RelatedTable] | \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment