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'
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:
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.