Skip to content

Commit 3ed4161

Browse files
jacalataclaude
andcommitted
Fix DataAccelerationReportItem.__repr__
repr() raised because it referenced self.site, which the item does not have, and a bare sheet_uri. Report the number of comparison records instead, and add a test. Co-Authored-By: Claude Code <noreply@anthropic.com>
1 parent 52259d9 commit 3ed4161

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎tableauserverclient/models/data_acceleration_report_item.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, comparison_records):
4747
self._comparison_records = comparison_records
4848

4949
def __repr__(self):
50-
return f"<(deprecated)DataAccelerationReportItem site={self.site} sheet={sheet_uri}>"
50+
return f"<(deprecated)DataAccelerationReportItem records={len(self._comparison_records)}>"
5151

5252
@property
5353
def comparison_records(self):

‎test/test_data_acceleration_report.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,8 @@ def test_get_data_acceleration_report(server):
4545
assert "1.29" == data_acceleration_report.comparison_records[1].avg_non_accelerated_plt
4646
assert "3" == data_acceleration_report.comparison_records[1].accelerated_session_count
4747
assert "0.372" == data_acceleration_report.comparison_records[1].avg_accelerated_plt
48+
49+
50+
def test_data_acceleration_report_item_repr():
51+
item = TSC.models.DataAccelerationReportItem([])
52+
assert "records=0" in repr(item)

0 commit comments

Comments
 (0)