Created the ability to have an execute_mdx_dataframe_async(...) that will return multiple DFs#1400
Open
stevenorsini wants to merge 1 commit into
Open
Conversation
… to the execute_mdx_dataframe_async(...) that will return a list of DataFrames, in the order of the MDX's passed in, rather then a concatenated DataFrame.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new CellService helper to execute multiple MDX queries concurrently and return a list of DataFrames (one per MDX), instead of concatenating results into a single DataFrame.
Changes:
- Introduces
execute_mdx_dataframes_async(...)to returnList[DataFrame]in the same order as the input MDX list. - Reuses the existing threadpool +
asyncio.run()execution pattern used elsewhere inCellService.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| shaped: bool = False, | ||
| mdx_headers: bool = False, | ||
| **kwargs, | ||
| ) -> list[pd.DataFrame]: |
Comment on lines
+2974
to
+2977
| def execute_mdx_dataframes_async( | ||
| self, | ||
| mdx_list: List[Union[str, MdxBuilder]], | ||
| max_workers: int = 8, |
Collaborator
|
Looks good! Thanks @stevenorsini Please add a few test cases and use the legacy type annotation ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You can pass in multiple MDXs to the function and get a list of DataFrames back, in order of the MDXs.