Skip to content

Get_Elements_Dataframe fails when an attribute has the same name as the dimension/hierarchy #1234

@RobbyMeyers

Description

@RobbyMeyers

Using the Get_Elements_Dataframe function fails when there is an attribute with same name as the dimension. There is a uniqueness error produced.

ValueError: The column label 'Dimension Name' is not unique.

Because the attribute data is joined back to the element data there has to be a unique key/column (IE the dimension name column that holds the element names)

To Reproduce
Create a dimension called MyDim and then create an attribute for elements in that dimension called MyDim.

Expected behavior
I have modified the code to add a suffix to any attributes that have the same name as the dimension which solves the issue. Not sure if this is the best way to go about this or not.

Version
TM1py 2.1
TM1 Server Version: 11.0.6.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions