-
Notifications
You must be signed in to change notification settings - Fork 437
refactor request_options, add language param #1481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
v0.33 Features: - add name, datasource-name to Job item - enable bulk add and remove users - Linked Tasks: get, get by ID, run Now - implement Tags: create new, add/delete for workbooks, flows, datasources - get page and chunk size from env vars - add some repr implementations - implement virtual connections Bugfix: - #1447 - #1449
I have refactored the classes to separate options that can be used in querying content, and options that can be used for exporting data. "language" is only available for data exporting.
def page_number(self, page_number): | ||
self.pagenumber = page_number | ||
return self | ||
class _DataExportOptions(RequestOptionsBase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is _VizExportOptions
a better class name here as I believe options like maxAge
are limited to exporting API endpoints
# if 'high' isn't specified, the REST API endpoint returns an image with standard resolution | ||
class Resolution: | ||
High = "high" | ||
|
||
def __init__(self, imageresolution=None, maxage=-1): | ||
super().__init__() | ||
super().__init__(maxage=maxage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be a good time to add viz_height
& viz_width
to image request options?
if self.max_age != -1: | ||
params["maxAge"] = self.max_age | ||
if self.language: | ||
params["language"] = self._language |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params["language"] = self._language | |
params["language"] = self.language |
Seems unnecessary since they aren't actually doing any checks.
…t-python into jac/export-language
This reverts some of the files edited by black locally
* Feature: export custom views #999 (#1506) * feat(exceptions): separate failed signin error (#1478) * refactor request_options, add language param (#1481) * Set FILESIZE_LIMIT_MB via environment variables (#1466) * added PulseMetricDefine cap (#1490) * Adding project permissions handling for databases, tables and virtual connections (#1482) * fix: queryset support for flowruns (#1460) * fix: set unknown size to sys.maxsize * fix: handle 0 item response in querysets (#1501) * chore: support VizqlDataApiAccess capability (#1504) * refactor(test): extract error factory to _utils * chore(typing): flowruns.cancel can also accept a FlowRunItem * chore: type hint default permissions endpoints (#1493) * chore(versions): update remaining f-strings (#1477) * Make urllib3 dependency more flexible (#1468) * Update requests library for CVE CVE-2024-35195 (#1507) * chore(versions): Upgrade minimum python version (#1465) * ci: cache dependencies for faster builds (#1497) * ci: build on python 3.13 (#1492) * Update samples for Python 3.x compatibility (#1479) * chore: remove py2 holdover code (#1496) * #Add 'description' to datasource sample code (#1475) * Remove sample code showing group name encoding (#1486) * chore(typing): include samples in type checks (#1455) * fix: docstring on QuerySet * docs: add docstrings to auth objects and endpoints (#1484) * docs: docstrings for Server and ServerInfo (#1494) * docs: docstrings for user item and endpoint (#1485) * docs: docstrings for site item and endpoint (#1495) * docs: workbook docstrings (#1488) * #1464 - docs update for filtering on boolean values (#1471) --------- Co-authored-by: Brian Cantoni <bcantoni@salesforce.com> Co-authored-by: Jordan Woods <jorwoods@users.noreply.github.com> Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com> Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored-by: Henning Merklinger <henning.merklinger@gmail.com> Co-authored-by: AlbertWangXu <albert.xuwang@yahoo.com> Co-authored-by: TrimPeachu <77048868+TrimPeachu@users.noreply.github.com>
I have refactored the classes to separate options that can be used in querying content, and options that can be used for exporting data.
In the new Data Exports section, I've added the parameter "language" which can be used to change how the data in a workbook is localized for export.