MicroStrategy/mstrio-py

Throw better error message with invalid report id in to_dataframe()

Closed this issue · 4 comments

When calling report.to_dataframe() and the report_id is not valid then no data is returned.

An error is thrown on this line that the key 'data' is not found. It would be useful if a better error message is thrown to help the user.
_pagination = _instance['data']['paging']

Same thing happens when trying to fetch data from instance in prompted status. Error handling should indeed be improved

Hi @BramVe and @AndyNieubourg , thanks for reaching out to us. We have created a work item for thisi issue and will change it as soon as possible

Hi BramVe,
The refactored mstrio.application_objects.report.Report and mstrio.application_objects.datasets.cube.Cube will raise an appropriate error when the id/name parameters will be invalid.

Ra0R commented

@ignacyhologa

I think it would make sense to also update the code snippets accordingly:

https://github.com/MicroStrategy/mstrio-py/blob/master/code_snippets/cube_report.py