MicroStrategy / mstrio-py

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

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

Closed hustontrevor closed 1 year ago

hustontrevor commented 2 years ago

https://github.com/MicroStrategy/mstrio-py/blob/f63a1193b25a876b6621e919987f9a678e6a1fdb/mstrio/modeling/schema/attribute/attribute.py#L1086

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)

urszulajaczewska commented 2 years ago

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

urszulajaczewska commented 2 years ago

@hustontrevor fix will be available with next release

aksakalli commented 1 year ago

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

urszulajaczewska commented 1 year ago

@aksakalli fix will be available with Thursday release this week