Gremlin Query Execution Error: Cannot add a vertex where the partition key property has value 'null'.
with git clone https://github.com/Azure-Samples/azure-cosmos-db-graph-python-getting-started.git
Gremlin Query Execution Error: Cannot add a vertex where the partition key property has value 'null'.
with git clone https://github.com/Azure-Samples/azure-cosmos-db-graph-python-getting-started.git
Hi @xiaoliangyang-1295, please let us know if you need more details on this. if answer helped, you can mark it 'Accept Answer'.
Hi @xiaoliangyang-1295, welcome to Microsoft Q&A forum.
This error indicates that the partition key is not consistent between the cosmos account and python code.
If we look at the code, we have partition key mentioned as 'pk':
"g.addV('person').property('id', 'thomas').property('firstName', 'Thomas').property('age', 44).property('pk', 'pk')",
Now when we create a new database and graph in Azure Cosmos DB, please mention the partition key as pk as mentioned in below screenshot (Yellow highlighted section):

I was able to run the same code successfully by changing the db,coll and password only.
Please let me know if this works or else we can discuss further.
if answer helps, please mark it 'Accept Answer'
5 people are following this question.