-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Top level folders for QuickSight entities (#988)
* Add top-level folder for QuickSight assets * Refactor create_hierarchy
- Loading branch information
Showing
9 changed files
with
146 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from typing import List | ||
|
||
from metaphor.models.metadata_change_event import ( | ||
AssetPlatform, | ||
Hierarchy, | ||
HierarchyInfo, | ||
HierarchyLogicalID, | ||
HierarchyType, | ||
) | ||
|
||
|
||
def create_hierarchy( | ||
platform: AssetPlatform, | ||
path: List[str], | ||
name: str = "", | ||
hierarchy_type: HierarchyType = HierarchyType.VIRTUAL_HIERARCHY, | ||
) -> Hierarchy: | ||
""" | ||
Create a hierarchy with name | ||
""" | ||
return Hierarchy( | ||
logical_id=HierarchyLogicalID( | ||
path=[platform.value] + path, | ||
), | ||
hierarchy_info=( | ||
HierarchyInfo( | ||
name=name, | ||
type=hierarchy_type, | ||
) | ||
if name | ||
else None | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from typing import List | ||
|
||
from metaphor.common.hierarchy import create_hierarchy | ||
from metaphor.models.metadata_change_event import AssetPlatform, Hierarchy | ||
|
||
DASHBOARD_DIRECTORIES = ["DASHBOARD"] | ||
DATA_SET_DIRECTORIES = ["DATA_SET"] | ||
|
||
|
||
def create_top_level_folders() -> List[Hierarchy]: | ||
platform = AssetPlatform.QUICK_SIGHT | ||
|
||
return [ | ||
create_hierarchy(platform, DASHBOARD_DIRECTORIES, "Dashboards"), | ||
create_hierarchy(platform, DATA_SET_DIRECTORIES, "DataSets"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "metaphor-connectors" | ||
version = "0.14.107" | ||
version = "0.14.108" | ||
license = "Apache-2.0" | ||
description = "A collection of Python-based 'connectors' that extract metadata from various sources to ingest into the Metaphor app." | ||
authors = ["Metaphor <[email protected]>"] | ||
|
@@ -42,7 +42,7 @@ llama-index-readers-confluence = { version = "^0.1.4", optional = true } | |
llama-index-readers-notion = { version = "^0.1.6", optional = true } | ||
looker-sdk = { version = "^24.2.0", optional = true } | ||
lxml = { version = "~=5.0.0", optional = true } | ||
metaphor-models = "0.38.3" | ||
metaphor-models = "0.39.1" | ||
more-itertools = { version = "^10.1.0", optional = true } | ||
msal = { version = "^1.28.0", optional = true } | ||
msgraph-beta-sdk = { version = "~1.4.0", optional = true } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters