-
Notifications
You must be signed in to change notification settings - Fork 448
Description
Describe the bug
The CustomViewItem model in the TSC library is missing a setter method for the workbook attribute. While the @Property getter exists, attempting to assign a value to workbook results in an AttributeError. This prevents users from programmatically associating a workbook with a custom view during creation or update operations.
Versions
Details of your environment, including:
- Tableau Server version: 2024.2.13
- Python version: 3.12
- TSC library version: 0.38
To Reproduce
Steps to reproduce the behavior:
1. Initialize a CustomViewItem object.
2. Attempt to set the workbook attribute:
`custom_view.workbook = workbook_item`
3. See error: AttributeError: can't set attribute 'workbook' (or property 'workbook' of 'CustomViewItem' object has no setter).
Results
Error creating custom view: property 'workbook' of 'CustomViewItem' object has no setter
Expected Behavior
The workbook attribute should have a corresponding @workbook.setter to allow for the assignment of WorkbookItem objects, consistent with other attributes like owner.
Proposed Fix
In tableauserverclient/models/custom_view_item.py, the following setter should be added:
`
@Property
def workbook(self) -> Optional[WorkbookItem]:
return self._workbook
@workbook.setter
def workbook(self, value: WorkbookItem):
self._workbook = value
`