Partial matching of parameters is confusing
@cderv ya está trabajando en esto.
Desde el 31/10/2023.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
In Quarto 1.4.451, create the following dashboard with parameters:
---
title: "Sample dashboard"
format: dashboard
engine: knitr
params:
hello: 1
mello: "a character"
---
This should print out the value of `params$hello`: `{r} params$hello`.
This should print out the value of `params$mello`: `{r} params$mello`.
This shouldn't work because it's looking for a parameter that doesn't exist, `params$jello`: `{r} params$jello`.
This also shouldn't work because it's looking for a parameter that doesn't exist, `params$m`, but it does partial matching to `params$mello`, and the document renders: `{r} params$m`
It works, but I think it would be better if partial matching wasn't enabled by default for parameters.
Then add the following and re-render:
This doesn't work because it's doing partial matching and then failing when adding a number to a character `params$m + 2`: `{r} params$m + 2`.
You get the following error:
Quitting from lines 2-18 (untitled.qmd)
Error in `params$m + 2`:
! non-numeric argument to binary operator
Backtrace:
1. .QuartoInlineRender(params$m + 2)
Execution halted
It makes sense why this happens, but again, not doing partial matching by default would be less confusing.
Additionally, if I set partial matching to warn in the YAML of my document, e.g.,
knitr:
opts_chunk:
R.options:
warnPartialMatchDollar: true
the first example with partial matching still runs, which was even more surprising to me.
- Lenguaje dominante
- JavaScript
- Estrellas
- 6k
- Forks
- 458
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 41
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de quarto-dev/quarto-cli
-
binder bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
quarto-dev/quarto-cli#14907 · 3 comentarios ·
-
brand bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
quarto-dev/quarto-cli#14891 ·
-
brand bug html revealjs
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
quarto-dev/quarto-cli#14882 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
quarto-dev/quarto-cli#14875 ·
-
Percent scripts: accept raw-string (r""") and '''-delimited markdown cells, as jupytext writes them Abiertoengines-jupyter enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
quarto-dev/quarto-cli#14850 · 2 comentarios ·
Todos los issues de quarto-dev/quarto-cli
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
babalae/bettergi-scripts-list#3674 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
vadimdemedes/ink#1029 ·
-
code-quality refactoring
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
githubnext/gh-aw-cao#13143 ·