Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relative terminator is referring to wrong type #54

Closed
rkoschmitzky opened this issue Jul 4, 2023 · 0 comments
Closed

relative terminator is referring to wrong type #54

rkoschmitzky opened this issue Jul 4, 2023 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rkoschmitzky
Copy link
Contributor

Problem Statement

This code resolves the projections incorrectly and fails:

from trackteroid import *

empty_collection = Query(Asset).by_name("ThisDoesntExist123").get_first()
entity_collection = Query(Asset).get_first(projections=[ComponentLocation.resource_identifier])

for collection in [empty_collection, entity_collection]:
    result = collection.ComponentLocation.resource_identifier
    if result:
        print("Result: ", result)
    else:
        print("NO Result", result)

    result = collection.versions.get(ComponentLocation).resource_identifier
    if result:
        print("Result: ", result)
    else:
        print("NO Result", result)

Expected Behavior

This code shouldn't fail and correctly resolve the underlying relationship.

Context

Provide any relevant background information or context that may help in understanding the issue.

  • OS: Any
  • Python version: Any 3.x
  • Trackteroid version: main/v0.1.0rc4
  • Ftrack Python API version: 2.5.0
  • Ftrack Server version: -

The problem is that the underlying _get_relatives function still refers to the original collection entity type which is Asset instead of referring to AssetVersion retrieved via the versions attribute.

@rkoschmitzky rkoschmitzky added the bug Something isn't working label Jul 4, 2023
@rkoschmitzky rkoschmitzky self-assigned this Jul 4, 2023
@rkoschmitzky rkoschmitzky added this to the v0.1.0rc5 milestone Jul 5, 2023
rkoschmitzky added a commit that referenced this issue Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant