Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, comparison_records):
self._comparison_records = comparison_records

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

@property
def comparison_records(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import warnings

from .default_permissions_endpoint import _DefaultPermissionsEndpoint
from .endpoint import api, Endpoint
Expand All @@ -21,6 +22,39 @@ def baseurl(self):

@api(version="3.8")
def get(self, req_options=None):
"""
Gets the data acceleration report for the current site, which compares
page load times for sheets before and after data acceleration.

Deprecated: this method will be removed in a future release of this
library. Tableau retired data acceleration and its REST API methods
in Tableau Server 2026.2 (REST API 3.29). The method is not available
on Tableau Cloud.

REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_site.htm#get_data_acceleration_report

Parameters
----------
req_options : RequestOptions, optional
Options to pass to the request.

Returns
-------
DataAccelerationReportItem
The report, with one comparison record per accelerated sheet.

Warnings
--------
This method is deprecated. Tableau Cloud and Tableau Server 2026.2 and
later respond to this request with a 404 (error code 404003).
"""
warnings.warn(
"DataAccelerationReport.get is deprecated and will be removed. Tableau retired data acceleration "
"in Tableau Server 2026.2.",
DeprecationWarning,
# 3, not 2: the @api wrapper adds a frame, and the warning should point at the caller.
stacklevel=3,
)
logger.info("Querying data acceleration report")
url = self.baseurl
server_response = self.get_request(url, req_options)
Expand Down
9 changes: 8 additions & 1 deletion test/test_data_acceleration_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ def test_get_data_acceleration_report(server):
response_xml = GET_XML.read_text()
with requests_mock.mock() as m:
m.get(server.data_acceleration_report.baseurl, text=response_xml)
data_acceleration_report = server.data_acceleration_report.get()
with pytest.warns(DeprecationWarning, match="deprecated and will be removed") as record:
data_acceleration_report = server.data_acceleration_report.get()

assert record[0].filename == __file__
assert 2 == len(data_acceleration_report.comparison_records)

assert "site-1" == data_acceleration_report.comparison_records[0].site
Expand All @@ -43,3 +45,8 @@ def test_get_data_acceleration_report(server):
assert "1.29" == data_acceleration_report.comparison_records[1].avg_non_accelerated_plt
assert "3" == data_acceleration_report.comparison_records[1].accelerated_session_count
assert "0.372" == data_acceleration_report.comparison_records[1].avg_accelerated_plt


def test_data_acceleration_report_item_repr():
item = TSC.models.DataAccelerationReportItem([])
assert "records=0" in repr(item)
Loading