MicroStrategy / mstrio-py

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

mstrio-py 11.3.12.102 calling alter on objects returned by list_filters throws error #172

Closed vladbaja closed 1 month ago

vladbaja commented 8 months ago

We just upgraded to mstrio-py==11.3.12.102 and our code was doing: filters = list_filters(connection=self._connection, project_name=self._project_name)

and then at some point something like: filters[X].alter(description, qualification)

which throws: Object of type _MissingType is not JSON serializable

We upgraded from 11.3.9.103, and in that version the alter call worked.

mgorskiMicroStrategy commented 8 months ago

Hi @vladbaja Thanks we logged the issue and fix will be available with June release. The problem is caused by list_filters method which when creating Filter class object can't find type of every attribute and replaces it with _MissingType. Please use this workaround now:

filters = list_filters(connection=self._connection, project_name=self._project_name, to_dictionary=True)
for filter in filters:
    filter_obj = Filter(conn, id=filter['id'])
    filter_obj.alter(description, qualification)
vladbaja commented 8 months ago

Thanks! That's the workaround we implemented. We'll remove the workaround once you fix it, because we don't like to query each filter (the ones that need update) twice.

apiotrowskiMicroStrategy commented 1 month ago

Solution delivered. Closing