Tm1py: Subset name is case sensitive?

Created on 27 Jan 2021  路  4Comments  路  Source: cubewise-code/tm1py

When trying to update name of subset with:

subset_source = tm1_SRC.subsets.get(subset_name_SRC, dimension_name, hierarchy_name=None, private=subset_private )
subset_source.name = 'new name'

I get error: AttributeError: can't set attribute

I works when using instead (note the uppercase N in name):
subset_source.Name = 'new name'

bug

All 4 comments

Hi @hermie64,

just created a fix for this issue.
Please upgrade to the latest master branch from GitHub.

If upgrading is not an option, you can also update the "private" property _subset_name of subset_source like this.

from TM1py import TM1Service

with TM1Service(address="", port=12354, user="admin", password="apple", ssl=True) as tm1:
    subs = tm1.subsets.get("Subset1", "d1")

    subs._subset_name = "New Name"

    print(subs)

The reason you could change a Name property of the subset class is that python is so dynamic, that it allows you to create new properties in objects "on-the-fly"

Hi @MariusWirtz,

That's cool!

I upgraded to latest master branch and issue is fixed now.

Thanks!

For people like me to understand:

  1. You can create an instance of student (here it is the subset_source) and add as many properties as possible (ex - dob, class, rank, etc,.)
  2. You were not able to change subset_source.name earlier because we had it READ only, it is like you trying to change the student's roll number (which shouldn't be the case).

Anyway we made it READ/WRITE now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yyzz1010 picture yyzz1010  路  3Comments

user1493 picture user1493  路  3Comments

rclapp picture rclapp  路  6Comments

beckyconning picture beckyconning  路  3Comments

VY109 picture VY109  路  4Comments