Jump to content

session.get('TypedContext', entity['id']) returns None in Ftrack version 3.3.40


Remus Avram

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...