quarto-dev / quarto-dev/quarto-cli

!expr invalide with message in chunk option

Open
#11,897 2 comments 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Feb 10, 2025.

enhancement needs-discussion yaml-validation
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

!expr in chunk option don't work for message while it works e.g. error.

Steps to reproduce
---
title: test knitr
# validate-yaml: false
---

```{r}
#| label: chunk1

show.message <- FALSE
```

```{r}
#| label: chunk2
#| error: !expr "show.message"

message("this works")
```

```{r}
#| label: chunk3
#| message: !expr "show.message"

message("this doesn't work")
```

Expected behavior

This should not produce an error message.
Note that with validate-yaml: false not commented I'm able to render the quarto file

Actual behavior

Produce the following error message:

ERROR: Validation of YAML cell metadata failed.
In file test.qmd
(line 21, columns 13--33) Field "message" has value !expr "show.message", which must instead be one of: `true`, `false`, `NA`
Your environment

Ubuntu 24.04
Quarto 16.04
VSCodium 1.92.2

Quarto check output
quarto check
Quarto 1.6.40
[✓] Checking environment information...
      Quarto cache location: /home/lbeaulaton/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.6.40
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /usr/bin
      Version: 2023

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.3
      Path: /usr/bin/python3
      Jupyter: 5.3.2
      Kernels: python3

(\) Checking Jupyter engine render....Traceback (most recent call last):
  File "/opt/quarto/share/jupyter/jupyter.py", line 21, in <module>
    from notebook import notebook_execute, RestartKernel
  File "/opt/quarto/share/jupyter/notebook.py", line 20, in <module>
    from nbclient import NotebookClient
ModuleNotFoundError: No module named 'nbclient'
[✓] Checking Jupyter engine render....OK

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.