Skip to content

fix(graphql): Skip schema fields with empty fieldPaths to prevent the dataset mapper from erroring out #12562

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

Merged

Conversation

jayasimhankv
Copy link
Contributor

Background:
There have been some cases wherein the Schema fieldPath is ingested as an empty string due to which the UI retrieval (or the GQL query) fails in the SchemaMapper. Although the validation on field path has now been introduced with v.0.15 which would prevent schema fields with empty fieldPaths from being ingested, (ref code commit: https://github.com/datahub-project/datahub/blob/master/entity-registry/src/main/java/com/linkedin/metadata/aspect/validation/FieldPathValidator.java#L112), it would be ideal to add a check to eliminate fields with empty fieldPaths before mapping them so such existing datasets could be retrieved. This PR attempts to do so.

Example schema field with empty field path (data ingested pre-v0.15 FieldPathValidator implementation)
image

Failure retrieving this dataset:
image

GetDataset call fails:
image

image

Mapper error:
java.lang.IllegalArgumentException: Cannot create a Urn from tuple with an empty value

image

UI works after the fix and eliminates the field with empty fieldPath:
image

@rtekal - FYI please.

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 community-contribution PR or Issue raised by member(s) of DataHub Community labels Feb 5, 2025
@jayasimhankv jayasimhankv changed the title Skip schema fields with empty fieldPaths to prevent the dataset mapper from erroring out fix(): Skip schema fields with empty fieldPaths to prevent the dataset mapper from erroring out Feb 5, 2025
@jayasimhankv jayasimhankv changed the title fix(): Skip schema fields with empty fieldPaths to prevent the dataset mapper from erroring out fix(graphql): Skip schema fields with empty fieldPaths to prevent the dataset mapper from erroring out Feb 5, 2025
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Feb 5, 2025
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd47b11...bc38d04. Read the comment docs.

@rtekal
Copy link
Contributor

rtekal commented Feb 6, 2025

This PR looks good. Adds checks while retrieving data.

@jjoyce0510 jjoyce0510 merged commit 5ab2378 into datahub-project:master Feb 12, 2025
158 checks passed
ttekampe pushed a commit to ttekampe/datahub that referenced this pull request Feb 14, 2025
ksrinath pushed a commit to ksrinath/datahub that referenced this pull request Feb 14, 2025
shirshanka pushed a commit to shirshanka/datahub that referenced this pull request Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution PR or Issue raised by member(s) of DataHub Community needs-review Label for PRs that need review from a maintainer. product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants