Closed AlbertRapp closed 2 months ago
Shoot, I wonder if this is a reticulate, or a quarto bug? It looks like a class with the IPython display hooks (e.g. _repr_html_()
) gets displayed regardless of output
Here's the qmd I used to test:
```{r}
#| output: false
# R code chunk
1 + 1
#| output: false
# This PYTHON output is suppressed
1 + 1
#| output: false
class MyClass:
def _repr_html_(self):
return "<p>uh-oh</p>"
MyClass()
I've opened an issue on quarto--thanks for such a helpful qmd reproducing the issue!
Just to complete the loop -- I don't think there's currently a simple option for suppressing objects with a _repr_html_()
method, for the case where quarto punts to knitr (which is what it does when there are R and python code chunks).
However, one quick solution is to put a semi colon to suppress the output altogether:
```{python}
class MyClass:
def _repr_html_(self):
return "<p>uh-oh</p>"
MyClass(); # <---- NOTE THE SEMI COLON
Prework
Description
Hi there :wave:
This is probably not a highly relevant edge case. But in Quarto the option
output: false
doesn't work withgt
tables if there are both R and Python code chunks in the Quarto file. For other Python outputs, output suppression seems to be unaffected.Reproducible example