MicroStrategy / mstrio-py

Python integration for MicroStrategy
Apache License 2.0
90 stars 59 forks source link

Attribute Relationship Management #148

Closed DStavilaNI closed 10 months ago

DStavilaNI commented 1 year ago

Hey Guys,

I do have a question regarding Attribute Relationship Management. Specifically, for a given attribute, we are trying to programmatically set some children. The key for the target attribute is a form group.

image

The problem happens when attempting to get the attribute relationship candidates, using the list_relationship_candidates attribute method:

candidates = attr_item.list_relationship_candidates(already_used=True, to_dictionary=True). The method fails with the error ''NoneType' object is not iterable'. Looking a bit through list_relationship_candidates() I did find this:

image

and it explains why this method fails - the attribute key, which is a form group, does not have any expressions, hence the error.

Is it a known issue ? What would be the solution in this case - should I simply avoid using this method and set directly the attribute children?

Note: It works, for the same attribute, from the Workstation, when doing it manually.

urszulajaczewska commented 1 year ago

Hi @DStavilaNI, we've logged the defect for this issue. I'll let you know when the fix is available.

DStavilaNI commented 1 year ago

Cool, thank you.

urszulajaczewska commented 10 months ago

Hi @DStavilaNI, fix is now available with new mstrio-py release.