Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execute_mdx error when running mdx only one axis #416

Closed
cubewise-gng opened this issue Nov 9, 2020 · 1 comment · Fixed by #417
Closed

execute_mdx error when running mdx only one axis #416

cubewise-gng opened this issue Nov 9, 2020 · 1 comment · Fixed by #417
Labels

Comments

@cubewise-gng
Copy link
Contributor

Describe the bug
Running execute_mdx on a mdx with only one axis throws an error:

Traceback (most recent call last):
  File "C:/TM1py/gng//DEV.py", line 45, in <module>
    skip_rule_derived_cells=True)
  File "C:\ProgramData\Anaconda3\lib\site-packages\TM1py\Services\CellService.py", line 408, in execute_mdx
    **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\TM1py\Services\CellService.py", line 1412, in extract_cellset
    top=top)
  File "C:\ProgramData\Anaconda3\lib\site-packages\TM1py\Utils\Utils.py", line 169, in build_content_from_cellset_dict
    row_axis, column_axis, title_axis = extract_axes_from_cellset(raw_cellset_as_dict=raw_cellset_as_dict)
  File "C:\ProgramData\Anaconda3\lib\site-packages\TM1py\Utils\Utils.py", line 109, in extract_axes_from_cellset
    column_axis = axes[1] if axes[1] and "Tuples" in axes[1] and len(axes[1]["Tuples"]) > 0 else None
IndexError: list index out of range

To Reproduce

with TM1Service(address='localhost', port=12354, user='Admin', password='', ssl=True) as tm1:
    mdx = """
    SELECT {[d1].[e1], [d1].[e2]} * {[d2].[e1]} ON 0 FROM [c1]
    """
    cellset = tm1.cells.execute_mdx(mdx=mdx)

Expected behavior
Return cellset

Version
TM1py [e.g. 1.5.0]
TM1 Server Version: [e.g. 11.8]

Additional context
Add any other context about the problem here.

MariusWirtz added a commit that referenced this issue Nov 10, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fixes #416
@MariusWirtz
Copy link
Collaborator

@cubewise-gng

I think it's solved.
Please upgrade to the branch issue/416-allow-single-axis-mdx-selection and check if the issue is addressed.

You can upgrade with pip like this:
pip install https://github.com/cubewise-code/tm1py/archive/issue/416-allow-single-axis-mdx-selection.zip --upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants