From ee00b073472f10d4862b3156bf86ec08b77de730 Mon Sep 17 00:00:00 2001 From: Jordan Woods <13803242+jorwoods@users.noreply.github.com> Date: Tue, 15 Oct 2024 21:03:08 -0500 Subject: [PATCH] chore: remove examples --- tableauserverclient/server/pager.py | 18 ------- tableauserverclient/server/request_options.py | 53 ------------------- tableauserverclient/server/sort.py | 14 ----- 3 files changed, 85 deletions(-) diff --git a/tableauserverclient/server/pager.py b/tableauserverclient/server/pager.py index 2c05394e..3c7e60f7 100644 --- a/tableauserverclient/server/pager.py +++ b/tableauserverclient/server/pager.py @@ -51,24 +51,6 @@ class Pager(Iterable[T]): ------ ValueError If the endpoint is not a callable or an Endpoint object. - - Examples - -------- - >>> # Loop over all workbooks on the site - >>> for workbook in TSC.Pager(server.workbooks): - >>> print(workbook.name) - - >>> # Setting page size - >>> request_options = TSC.RequestOptions(pagesize=1000) - >>> all_workbooks = list(TSC.Pager(server.workbooks, request_options)) - - >>> # Starting on page 2 - >>> request_options = TSC.RequestOptions(pagenumber=2) - >>> for workbook in TSC.Pager(server.workbooks, request_options): - >>> print(workbook.name) - - >>> # Using in a list comprehension - >>> views = [view for view in TSC.Pager(workbook.views) if "sales" in view.name.lower()] """ def __init__( diff --git a/tableauserverclient/server/request_options.py b/tableauserverclient/server/request_options.py index f345919c..53d30841 100644 --- a/tableauserverclient/server/request_options.py +++ b/tableauserverclient/server/request_options.py @@ -55,23 +55,6 @@ class contained within this class. pagesize: int, optional The number of items to return per page. Default is 100. Can also read from the environment variable `TSC_PAGE_SIZE` - - Examples - -------- - >>> # Get the first 50 workbooks on the site - >>> request_options = TSC.RequestOptions(pagesize=50) - - >>> # Get the next 50 workbooks on the site - >>> request_options.page_number(2) - - >>> # Get the first 50 workbooks on the site, sorted by name - >>> request_options = TSC.RequestOptions(pagesize=50) - >>> request_options.sort.add(TSC.Sort(TSC.RequestOptions.Field.Name, TSC.Sort.Direction.Asc)) - - >>> # Get the first 50 workbooks on the site, filtered by a tag - >>> request_options = TSC.RequestOptions(pagesize=50) - >>> request_options.filter.add(TSC.Filter(TSC.RequestOptions.Field.Tags, TSC.Filter.Operator.Equals, "important")) - """ def __init__(self, pagenumber=1, pagesize=None): @@ -293,15 +276,6 @@ class CSVRequestOptions(_DataExportOptions): maxage: int, optional The maximum age of the data to export. Shortest possible duration is 1 minute. No upper limit. Default is -1, which means no limit. - - Examples - -------- - >>> # Export the view to CSV - >>> request_options = TSC.CSVRequestOptions() - >>> request_options.vf("Region", "West") - >>> server.views.populate_csv(view_item, request_options) - >>> with open("output.csv", "wb") as f: - >>> for chunk in view_item.csv(): """ extension = "csv" @@ -318,15 +292,6 @@ class ExcelRequestOptions(_DataExportOptions): maxage: int, optional The maximum age of the data to export. Shortest possible duration is 1 minute. No upper limit. Default is -1, which means no limit. - - Examples - -------- - >>> # Export the view to CSV - >>> request_options = TSC.CSVRequestOptions() - >>> request_options.vf("Region", "West") - >>> server.views.populate_csv(view_item, request_options) - >>> with open("output.csv", "wb") as f: - >>> for chunk in view_item.csv(): """ extension = "xlsx" @@ -349,15 +314,6 @@ class ImageRequestOptions(_DataExportOptions): maxage: int, optional The maximum age of the data to export. Shortest possible duration is 1 minute. No upper limit. Default is -1, which means no limit. - - Examples - -------- - >>> # Export the view to an image - >>> request_options = TSC.ImageRequestOptions() - >>> request_options.vf("Region", "West") - >>> server.views.populate_image(view_item, request_options) - >>> with open("output.png", "wb") as f: - >>> f.write(view_item.image) """ extension = "png" @@ -400,15 +356,6 @@ class PDFRequestOptions(_DataExportOptions): viz_width: int, optional The width of the viz in pixels. If specified, viz_height must also be specified. - - Examples - -------- - >>> # Export the view to a pdf - >>> request_options = TSC.PDFRequestOptions() - >>> request_options.vf("Region", "West") - >>> server.views.populate_pdf(view_item, request_options) - >>> with open("output.pdf", "wb") as f: - >>> f.write(view_item.pdf) """ class PageType: diff --git a/tableauserverclient/server/sort.py b/tableauserverclient/server/sort.py index 014ed81f..b7864592 100644 --- a/tableauserverclient/server/sort.py +++ b/tableauserverclient/server/sort.py @@ -11,20 +11,6 @@ class Sort: direction : str The direction to sort, either ascending (Asc) or descending (Desc). The options are defined in the RequestOptions.Direction class. - - Examples - -------- - - >>> # create a new instance of a request option object - >>> req_option = TSC.RequestOptions() - - >>> # add the sort expression, sorting by name and direction - >>> req_option.sort.add(TSC.Sort(TSC.RequestOptions.Field.Name, - TSC.RequestOptions.Direction.Asc)) - >>> matching_workbooks, pagination_item = server.workbooks.get(req_option) - - >>> for wb in matching_workbooks: - >>> print(wb.name) """ def __init__(self, field, direction):