MicroStrategy/mstrio-py

TypeError: AttributeSorts.__init__() missing 1 required positional argument: 'report_sorts'

Closed this issue · 4 comments

Seeing this error frequently in some of our older projects. Going over to Developer and into the Attribute to set the Report Sort to something besides 'None' fixes it, but then it just errors on another Attribute the next time I run the .py.

        list_of_all_atrs = list_attributes(connection=conn)#,limit=10)

        for a in list_of_all_atrs:
            if a.ancestors[1]['name'] != "System Objects":
                path = ""
                project = a.ancestors[0]['name']
                for p in a.ancestors[1:]:
                    path += "\\" + p['name']
                #print(path + "\\" + a.name)

                for attr_form in a.forms:  # a.forms IS THE ORIGIN OF THE ERROR
                    #print(attr_form.name)
                    if not attr_form.child_forms: #skip parent forms, the children ones will still print
                        for expr in attr_form.expressions:
                            #print(expr.expression.text)
                            for tbl in expr.tables:
                                #print(tbl.name)

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\mstrio\utils\entity.py:824, in EntityBase.getattribute(self, name)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\mstrio\modeling\schema\attribute\attribute.py:1086, in Attribute.forms(self)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\mstrio\utils\entity.py:835, in EntityBase.getattribute(self, name)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\mstrio\utils\entity.py:212, in EntityBase.fetch(self, attr)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\mstrio\utils\entity.py:353, in EntityBase._set_object_attributes(self, **kwargs)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\mstrio\utils\entity.py:329, in EntityBase.__compose_val(self, key, val)
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\mstrio\utils\helper.py:1113, in Dictable.from_dict(cls, source, connection, to_snake_case)

Hi @hustontrevor we've logged the defect and will investigate this issue.

@hustontrevor fix will be available with next release

any update with this issue? It's causing us problem as well and we implemented everything once again using the underlying http calls.

@aksakalli fix will be available with Thursday release this week