MicroStrategy / mstrio-py

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

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

Closed BramVe closed 3 years ago

BramVe commented 4 years ago

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']

AndyNieubourg commented 4 years ago

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

OskarDuda commented 3 years ago

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

ignacyhologa commented 3 years ago

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 1 year ago

@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