MicroStrategy / mstrio-py

Python integration for MicroStrategy
Apache License 2.0
89 stars 57 forks source link

Attribute Relationship Management #148

Closed DStavilaNI closed 6 months ago

DStavilaNI commented 11 months 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 11 months ago

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

DStavilaNI commented 11 months ago

Cool, thank you.

urszulajaczewska commented 6 months ago

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