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(ingest): add entity registry in codegen #6984

Merged
merged 6 commits into from
Jan 18, 2023

Conversation

hsheth2
Copy link
Collaborator

@hsheth2 hsheth2 commented Jan 9, 2023

This PR adds information from the entity registry to the codegen system. Specifically, it adds a get_aspect_info() method to aspects that contains the entity name, docs and category annotations if available, and list of supported aspects.

Why is this useful? It sets up some interesting use cases in the future:

  1. Deeper validation of MCPs - we should error if you try to add ChartInfo to a dataset.
  2. Will let us autogenerate urn classes for each entity.
  3. Build generic transformers instead of ones limited to a single entity type. Our current transformers only operate on datasets, but we'd like to build ones that can, for instance, add ownership to every entity that supports ownership.

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 ingestion PR or Issue related to the ingestion of metadata label Jan 9, 2023
Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

Pretty exciting PR. Can you please add explanation in the PR description for context?

@hsheth2
Copy link
Collaborator Author

hsheth2 commented Jan 10, 2023

@jjoyce0510 updated the PR description on why this is useful

"mxe/PlatformEvent.avsc",
"platform/event/v1/EntityChangeEvent.avsc",
"metadata/query/filter/Filter.avsc", # temporarily added to test reserved keywords support
def generate(entity_registry: str, schemas_path: str, outdir: str) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

When folks have custom extensions to base entity registry, is the idea that they would have merged these in advanced?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup

If they have custom extensions to the entity registry, they're almost certainly building this from source anyways, so it's an ok assumption to make

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

Looks solid to me.

@hsheth2 hsheth2 merged commit cb12910 into datahub-project:master Jan 18, 2023
@hsheth2 hsheth2 deleted the entity-registry branch January 18, 2023 03:41
shirshanka pushed a commit to shirshanka/datahub that referenced this pull request Jan 18, 2023
ericyomi pushed a commit to ericyomi/datahub that referenced this pull request Jan 18, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants