Downloading of PDFs etc is deferred/lazy
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 50/100
Research direction
Start at views.populate_pdf and inspect the similar view-population methods mentioned in the issue, along with their tests if present. Trace when the PDF request occurs relative to property access. Done means the PDF is fetched during population, remains available after sign-out or connection closure, and repeated property access does not fetch it again.
Written by the indexing model from the issue text.
Description
Describe the bug
views.populate_pdf and similar methods do not really populate the PDF but instead only populate a getter method which is later used upon property access. This has multiple drawbacks:
- The PDF is loaded multiple times if accessed more than once.
- Access to the PDF is no longer possible after closing the connection to the server
- Parallelizing the PDF fetching is really hard and unintuitive as the action does not happen where it should be but only later as a side effect of accessing the property. Property access should be as fast as possible and synchronous.
- Somewhat related to 3., this makes it impossible to create an asyncio wrapper for this library as property access must be synchronous in Python.
Versions
Details of your environment, including:
- Tableau Server version: Tableau Online
- Python version: 3.10.6
- TSC library version: 0.19.0
To Reproduce
with server.auth.sign_in(tableau_auth):
view = ...
server.views.populate_pdf(view, pdf_req_option)
pathlib.Path("output.pdf").write_bytes(view.pdf)
Results
It raises an error as it cannot receive the PDF any longer.
- Dominant language
- Python
- Stars
- 716
- Forks
- 446
- Avg merge
- 8d 8h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tableau/server-client-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
tableau/server-client-python#1865 ·
-
in-progress
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tableau/server-client-python#1829 · 1 comment ·
-
enhancement gap needs investigation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tableau/server-client-python#1322 · 1 comment ·
-
[Type2] Allow Incremental Refresh type schedules to be added via `server.schedules.add_to_schedule` Openhelp wanted Server-Side Enhancement ui-exists
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tableau/server-client-python#1101 · 3 comments ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tableau/server-client-python#783 · 5 comments ·
All issues in tableau/server-client-python
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·