verdan / pyatlasclient

Apache Atlas Python Client
https://pyatlasclient.readthedocs.io/en/latest/
Apache License 2.0
6 stars 5 forks source link

Relationship method does not work #3

Closed justin-- closed 2 years ago

justin-- commented 4 years ago

I have been trying out client.relationship.create(data=entity_def) and it is not sending the correct payload.

i followed the layout based on https://pyatlasclient.readthedocs.io/en/latest/usage.html#create-a-new-relationship-between-entities

in my logs i see this as the request body DEBUG:atlasclient.client:Request body: {"relationship": {}, "data": {"typeName": "...", "end1": {"typeName": "...", "uniqueAttributes": {"qualifiedName": "..."}}, "end2": {"typeName": "...", "uniqueAttributes": {"qualifiedName": "..."}}, "attributes": {"displayRank": 1}}}

Where as it should have just put everything inside "data" as the payload itself, not under a "data" json key.

I went into the library and updated the create method to directly put whatever the data parameter is, and it successfully worked. I think both create and update are incorrect in this regard.

verdan commented 4 years ago

@justin-- can you please open a PR with the fix you did in the library? More than happy to have some extra helping hands.

Which version of Atlas are you using? as it is working just fine for my, I am using latest master branch of Atlas.