Skip to content
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(ingest/powerbi): fix broken lineage between chart and dataset #11080

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
from datahub.metadata.urns import ChartUrn
from datahub.sql_parsing.sqlglot_lineage import ColumnLineageInfo
from datahub.utilities.dedup_list import deduplicate_list
from datahub.utilities.urns.urn_iter import lowercase_dataset_urn

# Logger instance
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -127,7 +128,7 @@ def __init__(
@staticmethod
def urn_to_lowercase(value: str, flag: bool) -> str:
if flag is True:
return value.lower()
return lowercase_dataset_urn(value)

return value

Expand Down Expand Up @@ -390,11 +391,13 @@ def to_datahub_dataset(

for table in dataset.tables:
# Create a URN for dataset
ds_urn = builder.make_dataset_urn_with_platform_instance(
platform=self.__config.platform_name,
name=self.assets_urn_to_lowercase(table.full_name),
platform_instance=self.__config.platform_instance,
env=self.__config.env,
ds_urn = self.assets_urn_to_lowercase(
builder.make_dataset_urn_with_platform_instance(
platform=self.__config.platform_name,
name=table.full_name,
platform_instance=self.__config.platform_instance,
env=self.__config.env,
)
)

logger.debug(f"dataset_urn={ds_urn}")
Expand Down
6 changes: 3 additions & 3 deletions metadata-ingestion/src/datahub/utilities/urns/urn_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _modify_at_path(
_modify_at_path(getattr(model, path[0]), path[1:], new_value)


def _lowercase_dataset_urn(dataset_urn: str) -> str:
def lowercase_dataset_urn(dataset_urn: str) -> str:
cur_urn = DatasetUrn.from_string(dataset_urn)
new_urn = DatasetUrn(
platform=cur_urn.platform, name=cur_urn.name.lower(), env=cur_urn.env
Expand All @@ -149,10 +149,10 @@ def lowercase_dataset_urns(
) -> None:
def modify_urn(urn: str) -> str:
if guess_entity_type(urn) == "dataset":
return _lowercase_dataset_urn(urn)
return lowercase_dataset_urn(urn)
elif guess_entity_type(urn) == "schemaField":
cur_urn = Urn.from_string(urn)
cur_urn._entity_ids[0] = _lowercase_dataset_urn(cur_urn._entity_ids[0])
cur_urn._entity_ids[0] = lowercase_dataset_urn(cur_urn._entity_ids[0])
return str(cur_urn)
return urn

Expand Down
Loading
Loading