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(properties) Add upsertStructuredProperties graphql endpoint for assets #9906

Conversation

chriscollins3456
Copy link
Collaborator

This PR adds a new graphQL endpoint that will allow us to add or update new or existing structured properties onto an entity. If you provide a structured property update in the input that already exists on the entity, we will change the values. If that property doesn't exist yet, we'll add it.

This PR also introduces a new policy specifically for whether or not the user has the privilege to edit properties on entities. If they don't have this property, we will throw an unauthorized error in this new resolver.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added product PR or Issue related to the DataHub UI/UX devops PR or Issue related to DataHub backend & deployment labels Feb 22, 2024
@@ -0,0 +1,171 @@
package com.linkedin.datahub.graphql.resolvers.structuredproperties;
Copy link
Collaborator

@david-leifker david-leifker Feb 22, 2024

Choose a reason for hiding this comment

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

The logic in this resolver seems like duplicate work to support replacing a structured property. This might be better using the structured property patch builder for this work. Or the generic patch builder. The patch support for structured properties was built to add/remove/replace structured property values on entities. The read current value and mutate is inherent in the patch operation for many kinds of aspects.

Copy link
Contributor

@samblackk samblackk left a comment

Choose a reason for hiding this comment

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

Approving UI

@chriscollins3456
Copy link
Collaborator Author

tried out the patch builder and it is actually not working right now for structured properties (throws errors when trying to ingest the change proposals it creates saying this isn't backed by a data map).

I don't have time to fix the patch builder but since I know the code I wrote works and is tested, I'm going to merge. We can refactor later once the patch builder is fixed.

@chriscollins3456 chriscollins3456 merged commit 5a3df32 into datahub-project:master Mar 20, 2024
39 checks passed
dushayntAW pushed a commit to dushayntAW/datahub that referenced this pull request Mar 21, 2024
sleeperdeep pushed a commit to sleeperdeep/datahub that referenced this pull request Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops PR or Issue related to DataHub backend & deployment product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants