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(findRelationshipsV2): change source/dest params from Urn to String #425

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

jsdonn
Copy link
Contributor

@jsdonn jsdonn commented Sep 12, 2024

Summary

There are cases when a user doesn't need to provide an urn for the destination. For example, they only specify the destination type (like "dataset") but without also providing a filter on the UrnField (like urn = "urn:li:dataset:foo"). The current implementation does not support this as it expects either an Urn or null for the source and destination entities. If null, there's no way to tell the API which type of destination to look for.

Testing Done

adjusted unit tests. ./gradlew build

Checklist

Copy link
Contributor

@ybz1013 ybz1013 left a comment

Choose a reason for hiding this comment

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

one question otherwise LGTM

@@ -526,7 +526,7 @@ OwnedBy.class, new LocalRelationshipFilter().setCriteria(new LocalRelationshipCr
LocalRelationshipFilter filterUrn2 = new LocalRelationshipFilter().setCriteria(new LocalRelationshipCriterionArray(filterUrnCriterion2));

// test owned by of crew2 can be found
List<OwnedBy> ownedByCrew2 = _localRelationshipQueryDAO.findRelationshipsV2(null, null, crewEntityUrn, filterUrn2,
List<OwnedBy> ownedByCrew2 = _localRelationshipQueryDAO.findRelationshipsV2(null, null, "crew", filterUrn2,
Copy link
Contributor

Choose a reason for hiding this comment

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

for the 3rd arg, are we passing in crew or leave it null?
If it doesn't change the implementation, can we leave it null? So in global API I wont have to extract it from urn. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The previous filter validation logic stated that "if entity urn is null, the filter must also be null. We should continue to enforce this for the case where the asset is a registered MG asset type.

So in the GQS, we need to pass in any non-null and non-empty string as this param if we want the query to find non-MG asset types.

@jsdonn jsdonn merged commit 7238493 into linkedin:master Sep 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants