awslabs / amazon-neptune-tools

Tools and utilities to enable loading data and building graph applications with Amazon Neptune.
Apache License 2.0
297 stars 151 forks source link

Upsert raising "edge already existing" error. #311

Closed DiegoTrigueros closed 1 year ago

DiegoTrigueros commented 1 year ago

Hello. I am making a very basic use of your library where I am trying to upsert edges using the batch utils upsert_edges function on AWS Lambda using python 3.8 and the latest version of your code at the time of writing. Data is already present on my Neptune cluster, so I would expect the function to execute the first part of the coalesce function, however I am getting a ConstraintViolationException because the "Edge with id already exists" and it seems as if the code is trying to insert that edge instead of updating it.

Steps to reproduce would be:

  1. Have a Neptune cluster with Edges and Vertices already created.
  2. Create a list of dictionaries to be upserted where the existing Edge ID's are present.
  3. Apply the upsert_edges function.

The weird thing is that with upsert_vertices it works perfectly.

DiegoTrigueros commented 1 year ago

Turns out I was malforming the records and had ~to and ~from columns facing to the same Vertex ID. My bad, closing this issue.