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

"Injected Parameters" code cell no longer inherits from "parameters" code cell #11990

Open
mcanouil opened this issue Jan 30, 2025 · 0 comments
Assignees
Labels
bug Something isn't working jupyter parameters regression Functionality that used to work but now is broken. triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone.
Milestone

Comments

@mcanouil
Copy link
Collaborator

Until 1.6.33, the "injected parameters" code cell inherited from the "parameters" code cell, but that's no longer the case starting with 1.6.34 which means the "injected parameters" code cell is always printed regardless of the settings set in the "parameters" code cell.

Take:

---
title: "Quarto Parameters"
format: html
engine: jupyter
---

```{python}
#| tags: [parameters]
#| include: false
username = None
password = None
```

```{python}
print(f"Hello, {username}!")
```

Using:

quarto render document.qmd --execute-param username:John
<=1.6.33 >=1.6.34
Image Image

Discussed in #11988

Originally posted by multimeric January 30, 2025

Description

Consider the following Quarto document which depends on the use of a username and password. We don't want to hardcode our authentication details into the notebook for security reasons, so we have added them as parameters. We have also added echo: false to the parameters block with the intention of hiding the username and password.

```{python}
#| tags: [parameters]
#| echo: false
username = None
password = None
```

```{python}
import requests
from requests.auth import HTTPBasicAuth

requests.get("https://example.com", auth=HTTPBasicAuth(username, password))
```

However, when we render this notebook, it appears as follows:
Screenshot 2025-01-30 at 11 09 26 AM

The parameter definition block has been successfully hidden, but the parameter values have not. Unfortunately there is no obvious way to hide it, despite it being security critical to do so.

One workaround I've discovered is to make the default computation block hidden, by adding this to the YAML header:

---
execute: 
  echo: false
---

This works, but has the downside that we now have to echo: true every subsequent block that we want to show, which is most of them.

I wonder if there is a better way to stop my parameters showing up?

This question/issue/feature request relates to #723 (comment), the status of which is not clear.

@mcanouil mcanouil added bug Something isn't working jupyter parameters regression Functionality that used to work but now is broken. triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. labels Jan 30, 2025
@cscheid cscheid added this to the v1.7 milestone Jan 30, 2025
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 regression Functionality that used to work but now is broken. triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone.
Projects
None yet
Development

No branches or pull requests

2 participants