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

feat(ingestion/dbt): multiple node owner separated by comma #9740

Merged

Conversation

sid-acryl
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Jan 29, 2024
@@ -278,30 +302,48 @@ def get_operation_value(
and operation_config[Constants.OWNER_TYPE]
):
owner_id = _get_best_match(match, "owner")
owner_ids: List[str] = []

if "," in owner_id:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need the if statement here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

"category": owner_category,
"categoryUrn": owner_category_urn,
}
sanitize_owner_ids = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we just set owner_ids directly? do we need sanitize_owner_ids?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used it directly. I used a separate one for readability.

operation_map[Constants.ADD_OWNER_OPERATION],
key=lambda x: dict(x)["urn"],
):
dict_owner_class = dict(x)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this necessary? shouldn't x already be a dict?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operation_map[Constants.ADD_OWNER_OPERATION] is pointing to set so we do need to convert dict into tuple before storing it, hence x is tuple

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added extra if condition, now it is dict only

@@ -160,7 +178,7 @@ def process(self, raw_props: Mapping[str, Any]) -> Dict[str, Any]:
operation_type, set()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add a special case for ownership, above the if isinstance(operation, (str, list)): line

operation_map[owner operation] should be a list, not a set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@hsheth2 hsheth2 added the merge-pending-ci A PR that has passed review and should be merged once CI is green. label Jan 30, 2024
@treff7es treff7es merged commit ad2df22 into datahub-project:master Jan 31, 2024
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata merge-pending-ci A PR that has passed review and should be merged once CI is green.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants