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(siblings) Fix editing of schema fields for siblings with unequal schemas #7199

Conversation

chriscollins3456
Copy link
Collaborator

Fixes a bug we were seeing where users were getting errors trying to edit schema fields for an entity with siblings where the two siblings either has mismatched schemas (edit a column that doesn't exist in the primary sibling) or if the primary sibling doesn't have a schema at all.

There were multiple different ways we could go about solving this, but we settled on the simplest way to just find the next sibling if something fails when editing schema fields and try that one. If there are no siblings or we try all siblings and keep failing, then throw the error.

This fix feels a bit hacky, but I think is the least risky path forward right now. It involves updating the 3 resolvers for editing schema field descriptions, terms, and tags.

Also fixes a UI sibling merge bug like we had before for schema fields, but for editable schema fields now. Merge based on key, not on the index of the array so we can display editable schema metadata info between siblings properly.

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 the product PR or Issue related to the DataHub UI/UX label Jan 31, 2023
@@ -107,6 +115,36 @@ private CompletableFuture<Boolean> updateDomainDescription(Urn targetUrn, Descri
});
}

// If updating schema field description fails, try again on a sibling until there are no more siblings to try. Then throw if necessary.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: try to use javadocs format:

/**

  • Attempts to update....
    */

Copy link
Collaborator

Choose a reason for hiding this comment

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

(may not be there yet)

@chriscollins3456 chriscollins3456 merged commit 8ef25e3 into datahub-project:master Feb 2, 2023
ericyomi pushed a commit to ericyomi/datahub that referenced this pull request Feb 8, 2023
oleg-ruban pushed a commit to RChygir/datahub that referenced this pull request Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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