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

Idempotent pageRank #721

Open
Mintactus opened this issue Aug 24, 2024 · 1 comment
Open

Idempotent pageRank #721

Mintactus opened this issue Aug 24, 2024 · 1 comment

Comments

@Mintactus
Copy link

The pageRank algo from the Python client is not idempotent.

I got this error:
neo4j.exceptions.ClientError: {code: Neo.ClientError.Procedure.ProcedureCallFailed} {message: Failed to invoke procedure gds.pageRank.mutate: Caused by: java.lang.UnsupportedOperationException: Node property pageRank already exists}

Could we have a replace option?

Also

@knutwalker
Copy link
Member

Hi @Mintactus,

none of our mutate algorithm procedures have an option to overwrite existing properties, which is by design. New property values, even if produced by the same algorithm on the same data, do not necessarily have to be the same data, by values or semantically. So, we can't assume that overwriting is safe and put up some hoops to get to that outcome.

In order to overwrite a property, you have to first drop it and then run the mutate algorithm again:

CALL gds.graph.nodeProperties.drop('g', 'property')
CALL gds.<algo>.mutate('g', {'mutateProperty': 'property', ...})

I'm gonna leave this issue open for now, since we could add a failIfMissing options to the config for nodeProperties.drop, to align it with graph.drop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants