Downloading of PDFs etc is deferred/lazy

Abierto
#1,104 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
50/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

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:

  1. The PDF is loaded multiple times if accessed more than once.
  2. Access to the PDF is no longer possible after closing the connection to the server
  3. 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.
  4. 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.

Lenguaje dominante
Python
Estrellas
716
Forks
446
Merge medio
8 d 8 h
PR fusionados (30 d)
2

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de tableau/server-client-python

Todos los issues de tableau/server-client-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.