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

Refactor Neo4jProxy table owners query for easier customization #2182

Merged
merged 7 commits into from
Aug 11, 2023

Conversation

B-T-D
Copy link
Contributor

@B-T-D B-T-D commented Aug 8, 2023

Description

For some users of Amundsen, it may prove helpful to customize logic for deciding who a table's "owners" are. This can be accomplished by breaking up the table metadata API's query to make a modular query for only the owners (as is already done when getting table readers, in Neo4jProxy._exec_usage_query).

The results of the new Neo4jProxy._exec_owners_query are then combined back into the return value of the Neo4jProxy.get_table method, preventing any disruption to the JSON shape expected by the frontend.

Motivation and Context

This solves the problem of companies that use Neo4j-based Amundsen being unable to customize what data is returned as a table's owners. For example if a company wanted to apply a custom sorting logic to multiple owners, or impute table ownership based on specialized business logic.

How Has This Been Tested?

I updated existing unit tests such that they still pass.

I also tested the service running locally and called it via an Amundsen frontend UI that was running locally.

Documentation

None

CheckList

  • PR title addresses the issue accurately and concisely
  • Updates Documentation and Docstrings
  • Adds tests
  • Adds instrumentation (logs, or UI events)

@boring-cyborg boring-cyborg bot added the area:metadata From the metadata folder label Aug 8, 2023
@B-T-D B-T-D changed the title Btd refactor table owners query Refactor table owners query for easier customization Aug 10, 2023
@B-T-D B-T-D changed the title Refactor table owners query for easier customization Refactor Neo4jProxy table owners query for easier customization Aug 10, 2023
@B-T-D B-T-D marked this pull request as ready for review August 10, 2023 20:45
@B-T-D B-T-D requested a review from a team as a code owner August 10, 2023 20:45
Copy link
Contributor

@kristenarmes kristenarmes left a comment

Choose a reason for hiding this comment

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

looks good, thanks! just one thing, can you bump the version in setup.py so we can release a new metadata version?

Signed-off-by: Ben Dye <[email protected]>
@B-T-D B-T-D merged commit 8c3ceb7 into main Aug 11, 2023
7 checks passed
@B-T-D B-T-D deleted the btd-refactor-table-owners-query branch August 11, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metadata From the metadata folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants