Skip to content

feat: add get_lineage support for neptune backend #1915

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

Conversation

Owen-CH-Leung
Copy link
Contributor

@Owen-CH-Leung Owen-CH-Leung commented Jun 27, 2022

Summary of Changes

Currently, using AWS Neptune as the backend, the get_lienage function is not implemented at the NeptuneGremlinProxy, AbstractGremlinProxy and BaseProxy, which means that the lineage graph & the frontend tab displaying lineage does not work properly due to the missing implementation. For details, you can refer to this chat :

https://amundsenworkspace.slack.com/archives/C01A87A5EUU/p1653483057967299?thread_ts=1653374819.089879&cid=C01A87A5EUU

Hence, this PR attempts to create such functionality so that lineage works fine using Neptune as backend.

Tests

I tested the code using my company's aws environment (which uses AWS neptune & opensearch as the backend) and it worked fine.

Documentation

N/A

CheckList

Make sure you have checked all steps below to ensure a timely review.

  • PR title addresses the issue accurately and concisely. Example: "Updates the version of Flask to v1.0.2"
  • PR includes a summary of changes.
  • PR adds unit tests, updates existing unit tests, OR documents why no test additions or modifications are needed.
  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does

@Owen-CH-Leung Owen-CH-Leung requested a review from a team as a code owner June 27, 2022 15:34
@boring-cyborg boring-cyborg bot added area:metadata From the metadata folder category:proxy labels Jun 27, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 27, 2022

Congratulations on your first Pull Request and welcome to Amundsen community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/amundsen-io/amundsen/blob/main/CONTRIBUTING.md)

@Owen-CH-Leung Owen-CH-Leung force-pushed the owenlch/feat-add-get_lineage-function-for-neptune-backend branch from 4bfb0f2 to d3b6c29 Compare June 27, 2022 15:44
Copy link
Member

@feng-tao feng-tao left a comment

Choose a reason for hiding this comment

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

could you add a test for the feature? and thanks for the contribution

@feng-tao
Copy link
Member

the CI fails

@Owen-CH-Leung Owen-CH-Leung force-pushed the owenlch/feat-add-get_lineage-function-for-neptune-backend branch from 3d88f7b to 1e8254c Compare June 28, 2022 05:20
@Owen-CH-Leung
Copy link
Contributor Author

the CI fails

Just pushed another commit which fixed the failed CI on my local environment. It should pass this time

@Owen-CH-Leung
Copy link
Contributor Author

could you add a test for the feature? and thanks for the contribution

Sure. Let me take a look at the existing test cases and see how I can modify them

@Owen-CH-Leung Owen-CH-Leung force-pushed the owenlch/feat-add-get_lineage-function-for-neptune-backend branch from b748f6c to 7bfc41f Compare June 29, 2022 15:19
@Owen-CH-Leung
Copy link
Contributor Author

could you add a test for the feature? and thanks for the contribution

@feng-tao Would you mind sharing with me how I can contribute to adding more test cases for the gremlin proxy that I've modified ? I've looked at this file which is for neo4j proxy but I couldn't find a similar one for neptune / gremlin proxy. The closest file I could find is this but it didn't look similar to that of neo4j...

Thanks a lot for your help.

@feng-tao
Copy link
Member

@Owen-LCH I think we could add a new test file, but we could do it in a different pr. The ci still fails with mypy error:

============ 268 passed, 42 skipped, 8 warnings in 89.47s (0:01:29) ============
python3 -m flake8
mypy --ignore-missing-imports --follow-imports=skip --strict-optional --warn-no-return .
metadata_service/proxy/gremlin_proxy.py:1816: error: Need type annotation for 'downstream_tables' (hint: "downstream_tables: List[<type>] = ...")
metadata_service/proxy/gremlin_proxy.py:1817: error: Need type annotation for 'upstream_tables' (hint: "upstream_tables: List[<type>] = ...")
Found 2 errors in 1 file (checked 96 source files)
setup.cfg: [mypy]: follow_imports: invalid choice 'True' (choose from 'normal', 'silent', 'skip', 'error')
make: *** [mypy] Error 1
Makefile:20: recipe for target 'mypy' failed
Error: Process completed with exit code 2.

@Owen-CH-Leung Owen-CH-Leung force-pushed the owenlch/feat-add-get_lineage-function-for-neptune-backend branch from cd7f8e4 to aef8a45 Compare June 30, 2022 07:24
@Owen-CH-Leung
Copy link
Contributor Author

python3 -m flake8

@feng-tao Sure. Let's do it in a seperate PR. I just pushed a new commit which fixes the mypy error & the import sequence error that is returned from isort ./ --check --diff. Running make test should pass now

@Owen-CH-Leung
Copy link
Contributor Author

@feng-tao Can I seek your help to start the unit test again ? Thanks

@feng-tao
Copy link
Member

feng-tao commented Jul 5, 2022

just restart the ci

@Owen-LCH
Copy link

Owen-LCH commented Jul 5, 2022

Thanks. I saw the CI tests are all passed. We can merge it to main now =)

@feng-tao feng-tao merged commit 0b39e4d into amundsen-io:main Jul 6, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 6, 2022

Awesome work, congrats on your first merged pull request!

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.

3 participants