Skip to content
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

fix: queryset support for flowruns #1460

Merged
merged 6 commits into from
Sep 20, 2024

Conversation

jorwoods
Copy link
Contributor

@jorwoods jorwoods commented Sep 12, 2024

FlowRun's get endpoint does not return a PaginationItem. This PR provides a tweak to QuerySet to enable a workaround so all items matching whatever filters are supplied.

It also corrects the return types of flowruns.get and fixes the XML test asset to reflect what is really returned by the server.

@jorwoods
Copy link
Contributor Author

A stop-gap for #1456 . Or a permanent fix if flowruns was never intended to return pagination XML.

@jorwoods
Copy link
Contributor Author

For endpoints like flowruns that do not return a PaginationItem, what should the len be? I set it to sys.maxsize in this PR because users may length check a QuerySet as part of a normal workflow. A len of 0 would be misleading, indicating to the user that there are no matches for the endpoint and/or filters they supplied. len must return a non-negative int. Sentinel values such as -1 or None do not work. This only leaves maxsize as the possible flag.

Could theoretically be changed to raise an exception when length checking a QuerySet that doesn't actually have a total_available from the pagination XML.

FlowRun's get endpoint does not return a PaginationItem. This
provides a tweak to QuerySet to provide a workaround so all items
matching whatever filters are supplied.

It also corrects the return types of flowruns.get and fixes the XML
test asset to reflect what is really returned by the server.
Users may length check a QuerySet as part of a normal workflow. A len of
0 would be misleading, indicating to the user that there are no matches
for the endpoint and/or filters they supplied. __len__ must return a
non-negative int. Sentinel values such as -1 or None do not work. This
only leaves maxsize as the possible flag.
tableauserverclient/server/query.py Outdated Show resolved Hide resolved
tableauserverclient/server/query.py Show resolved Hide resolved
test/test_flowruns.py Outdated Show resolved Hide resolved
@jacalata jacalata merged commit 6ec632e into tableau:development Sep 20, 2024
22 checks passed
@jorwoods jorwoods deleted the jorwoods/flowrun_fix branch September 20, 2024 22:54
jacalata pushed a commit that referenced this pull request Oct 24, 2024
* 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 <[email protected]>
Co-authored-by: Jordan Woods <[email protected]>
Co-authored-by: Jordan Woods <[email protected]>
Co-authored-by: Jac <[email protected]>
Co-authored-by: Henning Merklinger <[email protected]>
Co-authored-by: AlbertWangXu <[email protected]>
Co-authored-by: TrimPeachu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants