Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion TM1py/Services/SubsetService.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def delete_elements_from_static_subset(
return self._rest.DELETE(url=url, **kwargs)

def get_element_names(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add some test cases of possible argument combinations here Tests/SubsetService_test.py

self, dimension_name: str, hierarchy_name: str, subset: Union[str, Subset], private: bool = False, **kwargs
self, dimension_name: str, hierarchy_name: str, subset: Union[str, Subset] = None, private: bool = False, **kwargs
) -> List[str]:
"""
Retrieve element names from a static or dynamic subset.
Expand All @@ -213,6 +213,10 @@ def get_element_names(
:param kwargs: Additional arguments.
:return: List of element names.
"""
# backward compatibility for subset_name
if "subset_name" in kwargs:
subset = kwargs["subset_name"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

@cubewise-gng
please do another check to verify if subset and subet_name are both provided. In that case we can raise a ValuError


if isinstance(subset, str):
subset = self.get(subset, dimension_name, hierarchy_name, private=private, **kwargs)
elif not isinstance(subset, Subset):
Expand Down