Skip to content

Created the ability to have an execute_mdx_dataframe_async(...) that will return multiple DFs#1400

Open
stevenorsini wants to merge 1 commit into
cubewise-code:masterfrom
stevenorsini:return-multiple-async-dfs
Open

Created the ability to have an execute_mdx_dataframe_async(...) that will return multiple DFs#1400
stevenorsini wants to merge 1 commit into
cubewise-code:masterfrom
stevenorsini:return-multiple-async-dfs

Conversation

@stevenorsini

Copy link
Copy Markdown

You can pass in multiple MDXs to the function and get a list of DataFrames back, in order of the MDXs.

… 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 return List[DataFrame] in the same order as the input MDX list.
  • Reuses the existing threadpool + asyncio.run() execution pattern used elsewhere in CellService.

💡 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,
@MariusWirtz

Copy link
Copy Markdown
Collaborator

Looks good! Thanks @stevenorsini

Please add a few test cases and use the legacy type annotation (List), and then we can merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants