-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ingestion/powerbi): fix issue with broken report lineage #10910
Changes from 8 commits
32815a2
b735259
b3cb842
db6db1f
a512b13
45c21f1
6ebed8c
48bd34b
0e65348
c033a69
ddf124a
1022d64
f567258
4130d5b
8c8941d
ae891fb
3c49e46
cfa0f97
bc5781a
21d576e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,9 @@ | |
|
||
from datahub.emitter.mcp_patch_builder import MetadataPatchProposal | ||
from datahub.metadata.schema_classes import ( | ||
AccessLevelClass, | ||
AuditStampClass, | ||
ChangeAuditStampsClass, | ||
DashboardInfoClass as DashboardInfo, | ||
EdgeClass as Edge, | ||
GlobalTagsClass as GlobalTags, | ||
|
@@ -405,3 +407,119 @@ def remove_custom_property(self, key: str) -> "DashboardPatchBuilder": | |
""" | ||
self.custom_properties_patch_helper.remove_property(key) | ||
return self | ||
|
||
def set_title(self, title: str) -> "DashboardPatchBuilder": | ||
assert title, "DashboardInfo title should not be None" | ||
self._add_patch( | ||
DashboardInfo.ASPECT_NAME, | ||
"add", | ||
path="/title", | ||
value=title, | ||
) | ||
|
||
return self | ||
|
||
def set_description(self, description: str) -> "DashboardPatchBuilder": | ||
assert description, "DashboardInfo description should not be None" | ||
self._add_patch( | ||
DashboardInfo.ASPECT_NAME, | ||
"add", | ||
path="/description", | ||
value=description, | ||
) | ||
|
||
return self | ||
|
||
def add_custom_properties( | ||
self, custom_properties: Optional[Dict[str, str]] = None | ||
) -> "DashboardPatchBuilder": | ||
|
||
if custom_properties: | ||
for key, value in custom_properties.items(): | ||
self.custom_properties_patch_helper.add_property(key, value) | ||
|
||
return self | ||
|
||
def set_external_url(self, external_url: Optional[str]) -> "DashboardPatchBuilder": | ||
if external_url: | ||
self._add_patch( | ||
DashboardInfo.ASPECT_NAME, | ||
"add", | ||
path="/externalUrl", | ||
value=external_url, | ||
) | ||
return self | ||
|
||
def set_charts(self, charts: Optional[List[str]]) -> "DashboardPatchBuilder": | ||
if charts: | ||
self._add_patch( | ||
DashboardInfo.ASPECT_NAME, | ||
"add", | ||
path="/charts", | ||
value=charts, | ||
) | ||
|
||
return self | ||
|
||
def set_datasets(self, datasets: Optional[List[str]]) -> "DashboardPatchBuilder": | ||
if datasets: | ||
self._add_patch( | ||
DashboardInfo.ASPECT_NAME, | ||
"add", | ||
path="/datasets", | ||
value=datasets, | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Array fields function as maps, this needs to specify the extension at which the value is being added to in the path if it is expected to truly function as a patch, otherwise it will be treated as a full replacement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please give me the reference example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @RyanHolstien |
||
|
||
return self | ||
|
||
def set_dashboard_url( | ||
self, dashboard_url: Optional[str] | ||
) -> "DashboardPatchBuilder": | ||
if dashboard_url: | ||
self._add_patch( | ||
DashboardInfo.ASPECT_NAME, | ||
"add", | ||
path="/dashboardUrl", | ||
value=dashboard_url, | ||
) | ||
|
||
return self | ||
|
||
def set_access( | ||
self, access: Union[None, Union[str, "AccessLevelClass"]] = None | ||
) -> "DashboardPatchBuilder": | ||
if access: | ||
self._add_patch( | ||
DashboardInfo.ASPECT_NAME, | ||
"add", | ||
path="/access", | ||
value=access, | ||
) | ||
|
||
return self | ||
|
||
def set_last_refreshed( | ||
self, last_refreshed: Optional[int] | ||
) -> "DashboardPatchBuilder": | ||
if last_refreshed: | ||
self._add_patch( | ||
DashboardInfo.ASPECT_NAME, | ||
"add", | ||
path="/lastRefreshed", | ||
value=last_refreshed, | ||
) | ||
|
||
return self | ||
|
||
def set_last_modified( | ||
self, last_modified: "ChangeAuditStampsClass" | ||
) -> "DashboardPatchBuilder": | ||
if last_modified: | ||
self._add_patch( | ||
DashboardInfo.ASPECT_NAME, | ||
"add", | ||
path="/lastModified", | ||
value=last_modified, | ||
) | ||
|
||
return self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @RyanHolstien
I enhanced the code. Please check and confirm if it is ok. I verified this on local instance.