neo4j / graph-data-science

Source code for the Neo4j Graph Data Science library of graph algorithms.
https://neo4j.com/docs/graph-data-science/current/
Other
633 stars 161 forks source link

Error happens to update a Pregel procedure from 2.3.3 to 2.4.0 #277

Closed frank-zsy closed 1 year ago

frank-zsy commented 1 year ago

Describe the bug

I have developed a Pregel-based custom procedure and have released for several times, up to GDS 2.3.3.

And recently I tried to update the GDS to 2.4.0 which has a better GDS graph project interface. I use Gradle 8.1.1 and change the gdsVersion to 2.4.0 in the build.gradle file, and also added few new dependencies according to the bootstrap project.

But I got an error as below when I am building the plugin:

/openrank-neo4j-gds/build/generated/sources/annotationProcessor/java/main/gds/openrank/OpenRankPregelWriteProc.java:7: error: package org.neo4j.gds.core.write does not exist
import org.neo4j.gds.core.write.NodePropertyExporterBuilder;
                               ^
/openrank-neo4j-gds/build/generated/sources/annotationProcessor/java/main/gds/openrank/OpenRankPregelWriteProc.java:22: error: cannot find symbol
    public NodePropertyExporterBuilder nodePropertyExporterBuilder;
           ^
  symbol:   class NodePropertyExporterBuilder
  location: class OpenRankPregelWriteProc

The error is in the auto generated files and I have noticed that org.neo4j.gds.core.write.* has been removed in 2.4.x now.

How can I build a plugin with GDS 2.4.0 and is there anything wrong in my steps.

To Reproduce

GDS version: 2.4.0 Neo4j version: 5.6.0 Operating system: MacOS

Steps to reproduce the behavior:

Expected behavior

Successfully build a custom plugin with GDS 2.4.0

Additional context

vnickolov commented 1 year ago

Hi @frank-zsy thank you for using the library and reporting this issue, we have been doing some module restructuring which seems to be affecting you, sorry about that.

You will need to add a compile dependency to your build.gradle

    compileOnly "org.neo4j.gds:core-write$gdsVersion"

Please give this a try and let us know if the problem still exists.

vnickolov commented 1 year ago

@frank-zsy please check this PR https://github.com/X-lab2017/openrank-neo4j-gds/pull/2 it should allow you to update to GDS 2.4.2

frank-zsy commented 1 year ago

@vnickolov Great thanks for the PR, all works fine with the update. Should I add a PR to add the missing dependencies in the Pregel bootstrap project in 2.4 branch?

vnickolov commented 1 year ago

We will check the dependencies for Pregel at our end, really sorry for the inconvenience. I am closing this for now, please get in touch if you have any issues or comments.

vnickolov commented 1 year ago

Just checked, and it seems correct on the GDS 2.4 branch, see https://github.com/neo4j/graph-data-science/blob/2.4/examples/pregel-bootstrap/build.gradle

frank-zsy commented 1 year ago

@vnickolov I do not see core-write in the 2.4 branch's build.gradle file. Actually that is why I encounter the error.

vnickolov commented 1 year ago

Good point, we'll make sure that is there, thank you again 🙇

vnickolov commented 1 year ago

@frank-zsy here is the test as discussed https://github.com/neo4j/graph-data-science/commit/f583d62ddecf21e0bc56dd16e86918b6cc7b7e77 🙂