Hello im passing in a spreadsheet into python trying to create many asset builds and folder etc. from this and i keep getting the below error which i believe is because i have multiple objects in the same hierarchy so its trying to create the upper objects int he hierarchy twice, what is the best way you guys have found to catch this or query if that item exists before creating my code it similar to below below
ERROR
ftrack_api.exception.ServerError: Server reported error: IntegrityError((_mysql_exceptions.IntegrityError) (1062, "Duplicate entry '780a712a-9bc3-11ea-b9ae-d61ccb4e321b-Assets' for key 'context_parent_id_key'") [SQL: u'INSERT INTO context (context_type, name, parent_id, id) VALUES (%s, %s, %s, %s)'] [parameters: (('task', 'Assets', u'780a712a-9bc3-11ea-b9ae-d61ccb4e321b', u'2fec278a-12d1-44fa-8e26-adc3b218a6bf'), ('task', 'Assets', u'780a712a-9bc3-11ea-b9ae-d61ccb4e321b', u'72fd181f-f72d-4f87-9cd8-74e579cfa588'), ('task', 'Assets', u'780a712a-9bc3-11ea-b9ae-d61ccb4e321b', u'9261c102-080b-45c6-9a07-d3e4eeca3fc1'))] (Background on this error at: http://sqlalche.me/e/gkpj))
[Finished in 21.9s]
CODE:
task = FTrack_session.create(object_type,{'name':object_name,'parent':FTrack_object_parent})