Remus Avram Posted February 27, 2017 Report Share Posted February 27, 2017 Hi, ones we migrated to Ftrack v3.3.40 we have this issue: asset_group = <dynamic ftrack AssetGroup object 139959472022992> test = session.get('TypedContext', asset_group['id']) print test print asset_group['id'] Return: None '296f6125-cf04-4779-8e8b-d90f7f06d217' This works: entity = session.query("Sequence").first() x = "{0}".format(entity['id']) print x test = session.get('TypedContext', x) print test Return: 06af6a36-e3d3-11e6-8d9b-005056a745de <Sequence(06af6a36-e3d3-11e6-8d9b-005056a745de)> This doesn't: entity = session.query("Sequence").first() x = "'{0}'".format(entity['id']) print x test = session.get('TypedContext', x) print test Return: '06af6a36-e3d3-11e6-8d9b-005056a745de' None Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted February 28, 2017 Report Share Posted February 28, 2017 Hi Remus, asset_group = <dynamic ftrack AssetGroup object 139959472022992> test = session.get('TypedContext', asset_group['id']) print test print asset_group['id'] Return: None '296f6125-cf04-4779-8e8b-d90f7f06d217' Can you reproduce this ? This looks like a bug to me where as your other example here I can understand: This doesn't: entity = session.query("Sequence").first() x = "'{0}'".format(entity['id']) print x test = session.get('TypedContext', x) print test Return: '06af6a36-e3d3-11e6-8d9b-005056a745de' None The code above is the equivalent of: session.get('TypedContext, ''06af6a36-e3d3-11e6-8d9b-005056a745de'') The id of the entity is 06af6a36-e3d3-11e6-8d9b-005056a745de without quotes - but you try to query for an item with id with quotes: '06af6a36-e3d3-11e6-8d9b-005056a745de' Link to comment Share on other sites More sharing options...
Remus Avram Posted February 28, 2017 Author Report Share Posted February 28, 2017 4 hours ago, Mattias Lagergren said: Can you reproduce this ? This looks like a bug to me Sorry, forgot to include all the code: asset_group = session.create("AssetGroup", {'name': name, 'parent': parent}) print asset_group # assert the object is created test = session.get('TypedContext', asset_group['id']) print test print asset_group['id'] Return: <dynamic ftrack AssetGroup object 139959472022992> None '296f6125-cf04-4779-8e8b-d90f7f06d217' The second and third example is what I suppose is happening. PS: Instead if I query for the object, it's returning the right data format. Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted March 1, 2017 Report Share Posted March 1, 2017 What happens if you stick a session.commit() between: asset_group = session.create(... and test = session.get('TypedContext', ... Link to comment Share on other sites More sharing options...
Remus Avram Posted March 2, 2017 Author Report Share Posted March 2, 2017 Hi Mattias! I found the (internal) problem. session.get('TypedContext') returns right object. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.