Skip to content

Commit

Permalink
style: black
Browse files Browse the repository at this point in the history
  • Loading branch information
jorwoods committed Nov 6, 2024
1 parent 30110ca commit aed0fa9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
29 changes: 17 additions & 12 deletions tableauserverclient/server/request_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class contained within this class.
>>> request_options.filter.add(TSC.Filter(TSC.RequestOptions.Field.Tags, TSC.Filter.Operator.Equals, "important"))
"""

def __init__(self, pagenumber=1, pagesize=None):
self.pagenumber = pagenumber
self.pagesize = pagesize or config.PAGE_SIZE
Expand Down Expand Up @@ -325,54 +326,57 @@ class CSVRequestOptions(_DataExportOptions):
"""
Options that can be used when exporting a view to CSV. Set the maxage to control the age of the data exported.
Filters to the underlying data can be applied using the `vf` and `parameter` methods.
Parameters
----------
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.
"""

extension = "csv"


class ExcelRequestOptions(_DataExportOptions):
"""
Options that can be used when exporting a view to Excel. Set the maxage to control the age of the data exported.
Filters to the underlying data can be applied using the `vf` and `parameter` methods.
Parameters
----------
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.
"""

extension = "xlsx"


class ImageRequestOptions(_ImagePDFCommonExportOptions):
"""
Options that can be used when exporting a view to an image. Set the maxage to control the age of the data exported.
Filters to the underlying data can be applied using the `vf` and `parameter` methods.
Parameters
----------
imageresolution: str, optional
The resolution of the image to export. Valid values are "high" or None. Default is None.
Image width and actual pixel density are determined by the display context
of the image. Aspect ratio is always preserved. Set the value to "high" to
ensure maximum pixel density.
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.
viz_height: int, optional
The height of the viz in pixels. If specified, viz_width must also be specified.
viz_width: int, optional
The width of the viz in pixels. If specified, viz_height must also be specified.
"""

extension = "png"

# if 'high' isn't specified, the REST API endpoint returns an image with standard resolution
Expand All @@ -394,25 +398,26 @@ class PDFRequestOptions(_ImagePDFCommonExportOptions):
"""
Options that can be used when exporting a view to PDF. Set the maxage to control the age of the data exported.
Filters to the underlying data can be applied using the `vf` and `parameter` methods.
Parameters
----------
page_type: str, optional
The page type of the PDF to export. Valid values are accessible via the `PageType` class.
orientation: str, optional
The orientation of the PDF to export. Valid values are accessible via the `Orientation` class.
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.
viz_height: int, optional
The height of the viz in pixels. If specified, viz_width must also be specified.
viz_width: int, optional
The width of the viz in pixels. If specified, viz_height must also be specified.
"""

class PageType:
A3 = "a3"
A4 = "a4"
Expand Down
3 changes: 2 additions & 1 deletion tableauserverclient/server/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Sort:
Examples
--------
>>> # create a new instance of a request option object
>>> req_option = TSC.RequestOptions()
Expand All @@ -26,6 +26,7 @@ class Sort:
>>> for wb in matching_workbooks:
>>> print(wb.name)
"""

def __init__(self, field, direction):
self.field = field
self.direction = direction
Expand Down

0 comments on commit aed0fa9

Please sign in to comment.