Conversation
…nzool/datahub into feat/add-domain-argument-for-superset
…nzool/datahub into feat/add-domain-argument-for-superset
|
|
||
| def construct_dashboard_from_api_data(self, dashboard_data): | ||
| dashboard_urn = f"urn:li:dashboard:({self.platform},{dashboard_data['id']})" | ||
| dashboard_urn = f"urn:li:dashboard:({self.platform},{self.platform_instance}{dashboard_data['id']})" |
There was a problem hiding this comment.
let's use our make_chart_urn and make_dashboard_urn helpers - they also have a proper platform_instance kwargs, which should also let us avoid needing self.platform_instance
There was a problem hiding this comment.
Thank you for the tip 👍
It works fine perfectly 👌
Example of logs:
'entities': {'dashboard': ['urn:li:dashboard:(superset,prod-bedrock.508)',
'urn:li:dashboard:(superset,prod-bedrock.543)',
'urn:li:dashboard:(superset,prod-bedrock.242)',
'urn:li:dashboard:(superset,prod-bedrock.337)',
'urn:li:dashboard:(superset,prod-bedrock.509)',
'urn:li:dashboard:(superset,prod-bedrock.567)',
'urn:li:dashboard:(superset,prod-bedrock.118)',
'urn:li:dashboard:(superset,prod-bedrock.428)',
'urn:li:dashboard:(superset,prod-bedrock.340)',
'urn:li:dashboard:(superset,prod-bedrock.183)',
'... sampled of 212 total elements'],
'chart': ['urn:li:chart:(superset,prod-bedrock.3143)',
'urn:li:chart:(superset,prod-bedrock.9784)',
'urn:li:chart:(superset,prod-bedrock.11400)',
'urn:li:chart:(superset,prod-bedrock.11399)',
'urn:li:chart:(superset,prod-bedrock.11398)',
'urn:li:chart:(superset,prod-bedrock.10060)',
'urn:li:chart:(superset,prod-bedrock.10052)',
'urn:li:chart:(superset,prod-bedrock.10050)',
'urn:li:chart:(superset,prod-bedrock.10046)',
'urn:li:chart:(superset,prod-bedrock.11396)',
| def get_report(self) -> StaleEntityRemovalSourceReport: | ||
| return self.report | ||
|
|
||
| def _gen_domain_urn(self, title: str) -> Optional[str]: |
There was a problem hiding this comment.
we have a "DomainRegistry" helper, which lets us convert domain names into urns using a lookup against DataHub - let's see if we can reuse the same pattern
A good example to copy would be the kafka integration's domain support:
There was a problem hiding this comment.
Ok thanks, it's done 👍 Let me know if it is what you expected
There was a problem hiding this comment.
Although, I removed the _get_domain_urn to have only one function _get_domain_wu (I don't think it's relevant to have two distinct functions here)
480a18e to
bd91e40
Compare
bd91e40 to
c19bd28
Compare
|
@rinzool We merged in your other superset PRs. Seems they caused a conflict. If you could resolve that and ensure lint is passing we can get this merged in |
7b4a3f9 to
baa0565
Compare
Yep with 3 PRs I expected some conflicts 😅 I resolved them, CI should be successful (it's ok locally) Note that I can edit unit tests to add a test for domain and platform instance too |
…ument-for-superset
baa0565 to
0d8fd42
Compare
… mappings (#9647) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…harts Superset has accepted platform_instance since datahub-project#9647 but never emitted the dataPlatformInstance aspect, so the Navigate panel files every dashboard and chart under "Default" no matter how many deployments are ingested. Add a get_data_platform_instance helper, modelled on Tableau's except that it returns nothing when platform_instance is unset, so existing deployments and the five existing goldens are untouched. Append the aspect at the dashboard and chart snapshot sites and declare the PLATFORM_INSTANCE capability. Preset builds on this source and inherits both with no code of its own; a unit test pins that its aspect resolves to the preset platform. Datasets are deliberately left out. Their URNs are built through get_datasource_urn_from_id with plain make_dataset_urn and carry no instance (the instance-aware gen_dataset_urn helper exists but is unused), so an aspect on them would name an instance the URN does not have, and two deployments exposing the same table would overwrite each other's aspect on the one entity. Making the dataset URN instance-aware is a breaking change that also moves chart-to-dataset lineage, so it belongs with the containers follow-up. A unit test pins the omission and the TODO says why. Tests: unit present/absent cases for dashboards and charts, an empty-string case, the Preset inheritance cases, and one integration test with a new golden that sets platform_instance. Docs: a Platform instance section on both connector pages. The connector registry JSON is regenerated. Fixes datahub-project#11153
Checklist
Description
Hi, in my company we really need a simple way to add a domain to chart/dashboard entities coming from Superset.
So I copied what is done for Glue ingestion and add a
domainargument in the configI tried locally and it works as I expected 👌
Furthermore I add a
platform_instanceargument and deprecateenvargument that commit b088512 (It may be done in another PR if necessary)Example output when running ingestion:
Config:
Output: