datahub
datahub copied to clipboard
fix(graphql): add missing entities to EntityTypeMapper and EntityTypeUrnMapper
When trying to get all (Custom) Ownership Types using the DataHubGraph class and it's get_urns_by_filter method in Python, I noticed that the GraphQL API currently doesn't allow to search for multiple entity types.
The query I have tested resp. is used by get_urns_by_filter is:
{
scrollAcrossEntities(input: { types: [CUSTOM_OWNERSHIP_TYPE], query: "*" }) {
searchResults {
entity {
urn
}
}
}
}
The response I get from the GraphQL API (e.g. using the demo):
{
"errors": [
{
"message": "Unknown entity type: CUSTOM_OWNERSHIP_TYPE",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"scrollAcrossEntities"
],
"extensions": {
"code": 400,
"type": "BAD_REQUEST",
"classification": "DataFetchingException"
}
}
],
"data": {
"scrollAcrossEntities": null
},
"extensions": {}
}
The error message "Unknown entity type: [...]" is caused by the EntityTypeMapper.
Long story short: The CUSTOM_OWNERSHIP_TYPE was missing in the EntityTypeMapper, this PR adds the CUSTOM_OWNERSHIP_TYPE and all other missing entities to the EntityTypeMapper (and the EntityTypeUrnMapper). I have also reordered the existing entries to match the order of the (generated) EntityType enum (it was easier to check if an entity is missing or not doing so) and all entries are now using the constants defined...
Checklist
- [x] The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
- [x] Links to related issues (if applicable)
- [x] Tests for the changes have been added/updated (if applicable)
- [x] 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.
- [x] For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub
Summary by CodeRabbit
-
New Features
- Expanded support for additional entity types, including ER_MODEL_RELATIONSHIP, NOTEBOOK, CONTAINER, INGESTION_SOURCE, EXECUTION_REQUEST, ASSERTION, DATAHUB_POLICY, DATAHUB_ROLE, POST, SCHEMA_FIELD, QUERY, CUSTOM_OWNERSHIP_TYPE, INCIDENT, ROLE, FORM, DATA_TYPE, ENTITY_TYPE, among others.
-
Enhancements
- Updated and streamlined mappings between entity names and their corresponding URNs to improve data organization and access.
[!WARNING]
Rate limit exceeded
@Masterchen09 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 21 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the
@coderabbitai review
command as a PR comment. Alternatively, push new commits to this PR.We recommend that you space out your commits to avoid hitting the rate limit.
How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.
Commits
Files that changed from the base of the PR and between b150c8d5560f225a84cd421eadcface873d7c435 and 9deca3a0c9ec5cbbd32ec4853c5a91a3f041520b.
Walkthrough
The EntityTypeMapper
and EntityTypeUrnMapper
classes were updated to include new mappings for numerous entity types such as ER_MODEL_RELATIONSHIP
, NOTEBOOK
, CONTAINER
, and more. These changes ensure that the entity names are now consistently represented using constants, and new URN mappings were added for the corresponding entity types.
Changes
Files | Change Summary |
---|---|
datahub-graphql-core/src/.../EntityTypeMapper.java |
Updated mappings for various entity types using constants for entity names. |
datahub-graphql-core/src/.../EntityTypeUrnMapper.java |
Added and removed mappings between entity names and their corresponding URNs. |
Sequence Diagram(s)
No sequence diagrams are included as the changes are mappings updates without major control flow or feature modifications.
Poem
In the land of data, where entities roam,
Mappings updated, new constants found a home.
URNs now sparkle, with tags and notebooks too,
A web of connections, brilliantly blue.
From policies to roles, each type has its name,
Data's vast landscape, never quite the same.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>.
-
Generate unit testing code for this file.
-
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitai
in a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file.
-
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitai
in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai generate interesting stats about this repository and render them as a table.
-
@coderabbitai show all the console.log statements in this repository.
-
@coderabbitai read src/utils.ts and generate unit testing code.
-
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
-
@coderabbitai help me debug CodeRabbit configuration file.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (invoked as PR comments)
-
@coderabbitai pause
to pause the reviews on a PR. -
@coderabbitai resume
to resume the paused reviews. -
@coderabbitai review
to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full review
to do a full review from scratch and review all the files again. -
@coderabbitai summary
to regenerate the summary of the PR. -
@coderabbitai resolve
resolve all the CodeRabbit review comments. -
@coderabbitai configuration
to show the current CodeRabbit configuration for the repository. -
@coderabbitai help
to get help.
Additionally, you can add @coderabbitai ignore
anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configuration File (.coderabbit.yaml
)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yaml
file to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
PR #10502 added POST and QUERY to EntityTypeMapper...pulling/rebasing might have caused that those two entities appeared twice in the ImmutableMap which caused the tests to fail...should be fixed now.