MicroStrategy / mstrio-py

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

Invalid return type in function declaration publish in OlapCube module #143

Closed pawelgnatowski closed 1 year ago

pawelgnatowski commented 1 year ago

mstrio.py (11.3.9.103) from mstrio.project_objects.datasets import OlapCube

There is an error in mstrio - return Type for the publish cube function is set to None while in fact it does return response.json , which according to our rest api docs

/api/v2/cubes/{cube_id} 

should return {id:str,jobId:str} . 
    def publish(self) -> **None <=== here it is:**
        """Publish an OLAP Cube. Request to publish an OLAP Cube is an
        asynchronous operation, so the result of it can be seen after calling
        method `refresh_status()` inherited from Cube class.

        Returns:
            A dictionary with two keys identifying task IDs.
        """
        response = cubes.publish(self._connection, self._id)
        logger.info(f"Request for publishing cube '{self.name}' was sent.")
        **return response.json()**
urszulajaczewska commented 1 year ago

Hi @pawelgnatowski, We'll log the defect and fix annotation so that return type is correct. I'll update this issue when the changes are released.

mgorskiMicroStrategy commented 1 year ago

@pawelgnatowski It's already fixed in mstrio-py 11.3.11.101.