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

Add Neo4j plugin. #312

Merged
merged 8 commits into from
Jun 18, 2023
Merged

Add Neo4j plugin. #312

merged 8 commits into from
Jun 18, 2023

Conversation

Jedore
Copy link
Contributor

@Jedore Jedore commented Jun 14, 2023

Something about the plugin,
The major Neo4j DBMS versions are 5 and 4.4. The latest neo4j python driver version is 5.x.x which support both Neo4j DBMS 5 and 4.4 . And python driver 4.4.x differs much from 5.x.x .So the neo4j plugin only support neo4j python driver 5.x.x.
Reference:

"The latest 5.x driver supports connection to any Neo4j 5 and 4.4 instance, and will also be compatible with Neo4j 6." in https://neo4j.com/docs/python-manual/5/install/

Neo4j python driver 5.x.x provide two method Session.run()&Transaction.run() to execute Cypher statement with both sync and async mode. tests/plugin/data/sw_neo4j/services/provider.py contains these four cases:

  1. sync Session.run()
  2. sync Transaction.run()
  3. async Session.run()
  4. async Transaction.run()

@wu-sheng wu-sheng requested a review from Superskyyy June 14, 2023 09:58
@wu-sheng wu-sheng added the plugin Plugin label Jun 14, 2023
@wu-sheng wu-sheng added this to the 1.1.0 milestone Jun 14, 2023
@Superskyyy
Copy link
Member

Superskyyy commented Jun 14, 2023

@Jedore Thank you! Generally looks great! Please add the neo4j dependency to poetry plugins group as indicated in the PR template. And if you would like maybe also add a note in the neo4j plugin (You see there's a variable called note there), to indicate only the 5.x driver is supported and its fine since it can support both DBMS versions.

@Jedore
Copy link
Contributor Author

Jedore commented Jun 14, 2023

@Superskyyy Thanks great! Please review the note and prproject.toml.



def install():
from neo4j import AsyncSession, Session
Copy link

Choose a reason for hiding this comment

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

8% of developers fix this issue

E0401: Unable to import 'neo4j'

❗❗ 7 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
skywalking/plugins/sw_neo4j.py 36
skywalking/plugins/sw_neo4j.py 37
tests/plugin/data/sw_neo4j/services/consumer.py 20
tests/plugin/data/sw_neo4j/services/consumer.py 21
tests/plugin/data/sw_neo4j/services/provider.py 20
tests/plugin/data/sw_neo4j/services/provider.py 21
tests/plugin/data/sw_neo4j/services/provider.py 22

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.



def install():
from neo4j import AsyncSession, Session
Copy link

Choose a reason for hiding this comment

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

10% of developers fix this issue

reportMissingImports: Import "neo4j" could not be resolved

❗❗ 7 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
skywalking/plugins/sw_neo4j.py 36
skywalking/plugins/sw_neo4j.py 37
tests/plugin/data/sw_neo4j/services/consumer.py 20
tests/plugin/data/sw_neo4j/services/consumer.py 21
tests/plugin/data/sw_neo4j/services/provider.py 20
tests/plugin/data/sw_neo4j/services/provider.py 21
tests/plugin/data/sw_neo4j/services/provider.py 22

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.

@Superskyyy Superskyyy merged commit 6c29a96 into apache:master Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin Plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants