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

SQL cell (and others?) in jupyter engine and ipython kernel #4227

Open
cscheid opened this issue Feb 4, 2023 · 2 comments
Open

SQL cell (and others?) in jupyter engine and ipython kernel #4227

cscheid opened this issue Feb 4, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request jupyter
Milestone

Comments

@cscheid
Copy link
Collaborator

cscheid commented Feb 4, 2023

It might make sense for us to leverage cell magics to support (eg) a native sql cell in the same way that knitr does it.

Pros:

  • it's a popular request
  • it would us get closer to matching the behavior in the knitr engine

Cons:

  • it would make it even harder for beginners to reason about what engine is responsible for what execution. Specifically, cell magics are specific to the ipython kernel
  • it would not solve the problem for other jupyter kernels

If we continue to increase the ways in which different engines interpret {language} cells, I think it would be a good idea for quarto to be able to explain who runs what cells. I can imagine a TypeScript API that could do so.

@cscheid cscheid added enhancement New feature or request jupyter labels Feb 4, 2023
@eitsupi
Copy link
Contributor

eitsupi commented Feb 8, 2023

How about adding a filter to remove cell magic and an option to set the language of the output code block as desired (Same as knitr's lang chunk option), as like https://github.com/CenterOnBudget/quarto-stata-facade?

I imagine the following. This would be versatile (works with any cell magic).

source

```{python}
#| output-language: sql
%%sql postgresql://will:longliveliz@localhost/shakes
select * from character
```

output

```sql
select * from character
```

@cscheid
Copy link
Collaborator Author

cscheid commented Feb 8, 2023

The problem is that this filter needs to happen before jupyter execution, and our current infrastructure has pandoc running after jupyter (and knitr).

With that said, we will be eventually changing quarto to support two pandoc passes (pre-engine and post-engine), but that's on a 1.5-1.6 timeline.

@cscheid cscheid added this to the v1.4 milestone Feb 24, 2023
@cscheid cscheid modified the milestones: v1.4, v1.5 Dec 11, 2023
@cscheid cscheid modified the milestones: v1.5, Future Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request jupyter
Projects
None yet
Development

No branches or pull requests

2 participants