Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters and jupyter engine crashes when label is set #10097

Open
mcanouil opened this issue Jun 21, 2024 · 0 comments · May be fixed by #11262
Open

Parameters and jupyter engine crashes when label is set #10097

mcanouil opened this issue Jun 21, 2024 · 0 comments · May be fixed by #11262
Assignees
Labels
bug Something isn't working jupyter parameters
Milestone

Comments

@mcanouil
Copy link
Collaborator

mcanouil commented Jun 21, 2024

See the following simple code.
It appears the parameters code cell is duplicated when passing a new value for the parameter via the commande line.
Unfortunately, if the code cell initialising the parameters has a label it leads to a duplicate label error.

Tested on main (~1.5.46)

---
format: html
engine: jupyter
---

```{python}
#| label: test
#| tags: [parameters]
datapath = None
```

Trigger the crash by sending a new parameter value

quarto render index.qmd --execute-param datapath:"weird" --execute
Executing 'index.quarto_ipynb'
  Cell 1/2: 'test'...Done
  Cell 2/2: 'test'...Done

ERROR: Cell label names must be unique (found duplicate '#test')

Stack trace:
    at file:///Users/mcanouil/Projects/quarto/quarto-cli/src/core/jupyter/labels.ts:53:15
    at jupyterToMarkdown (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/core/jupyter/jupyter.ts:758:5)
    at eventLoopTick (ext:core/01_core.js:153:7)
    at async Object.execute (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/execute/jupyter/jupyter.ts:378:20)
    at async renderExecute (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-files.ts:232:25)
    at async renderFileInternal (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-files.ts:592:35)
    at async renderFiles (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-files.ts:325:9)
    at async render (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/render-shared.ts:102:18)
    at async Command.actionHandler (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/command/render/cmd.ts:248:26)
    at async Command.execute (file:///Users/mcanouil/Projects/quarto/quarto-cli/src/vendor/deno.land/x/[email protected]/command/command.ts:1948:7)

Keeping the default parameter value

quarto render index.qmd --execute
Executing 'index.quarto_ipynb'
  Cell 1/1: 'test'...Done

pandoc 
  to: html
  output-file: index.html
  standalone: true
  section-divs: true
  html-math-method: mathjax
  wrap: none
  default-image-extension: png
  
metadata
  document-css: false
  link-citations: true
  date-format: long
  lang: en
  
Output created: index.html

Originally posted by @mcanouil in #10081 (reply in thread)

@mcanouil mcanouil added bug Something isn't working jupyter parameters triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. labels Jun 21, 2024
@cscheid cscheid removed the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Jun 21, 2024
@cscheid cscheid added this to the v1.6 milestone Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jupyter parameters
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants