MicroStrategy / mstrio-py

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

overwrite the instance_id in to_dataframe function #75

Closed everthought closed 2 years ago

everthought commented 2 years ago

The to_dataframe function of the Report class overwrites the instance ID with None when a limit is set.

In my case, entries already made in a report instance were overwritten.

    def to_dataframe(self, limit: Optional[int] = None) -> pd.DataFrame:
        """Extract contents of a report instance into a Pandas `DataFrame`.

        Args:
            limit (None or int, optional): Used to control data extract
                behavior. By default (None) the limit is calculated
                automatically, based on an optimized physical size of one chunk.
                Setting limit manually will force the number of rows per chunk.
                Depending on system resources, a higher limit (e.g. 50,000) may
                reduce the total time required to extract the entire dataset.

        Returns:
            Pandas Data Frame containing the report contents.
        """
        if limit:
            self._initial_limit = limit
            self.instance_id = None

        if self.instance_id is None:
            res = self.__initialize_report(self._initial_limit)
urszulajaczewska commented 2 years ago

Hi, @everthought, we'll look into it and I'll come back with an answer as soon as possible.

urszulajaczewska commented 2 years ago

@everthought We'll fix it so changes will be available from the next release in March.

urszulajaczewska commented 2 years ago

Hi @everthought, we fixed this issue with March release.