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

fix: set options$engine to support quarto 1.3 #110

Merged
merged 3 commits into from Mar 14, 2023
Merged

Conversation

eitsupi
Copy link
Member

@eitsupi eitsupi commented Mar 14, 2023

Copy link

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good. You just need to check that changing the option here does not have side effect with knitr::knit_engines$get("sql") that you use after.

I don't think so.

Comment on lines 22 to +26
options$lang <- options$lang %||% "elm"

# Workaround for Quarto CLI 1.3
# https://github.com/quarto-dev/quarto-cli/pull/4735
options$engine <- "elm"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to be complete in your workaround, you probably need to use

options$engine <- options$lang in case a user has change the lang option . Otherwise it won't apply

Don't you think ?

Suggested change
options$lang <- options$lang %||% "elm"
# Workaround for Quarto CLI 1.3
# https://github.com/quarto-dev/quarto-cli/pull/4735
options$engine <- "elm"
options$lang <- options$lang %||% "elm"
# Workaround for Quarto CLI 1.3
# https://github.com/quarto-dev/quarto-cli/pull/4735
options$engine <- options$lang

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion!
I will add a test to make sure lang changes are possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the lang option is respected by the knitr::knit() function even without this change.
Is there any possibility that fixing engine to "elm" will cause any problems?

@eitsupi eitsupi marked this pull request as draft March 14, 2023 14:30
@eitsupi eitsupi marked this pull request as ready for review March 14, 2023 15:04
@eitsupi eitsupi enabled auto-merge (squash) March 14, 2023 15:07
@eitsupi eitsupi merged commit 63bba54 into main Mar 14, 2023
@eitsupi eitsupi deleted the fix-for-quarto1.3 branch March 14, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PRQL code blocks are not rendered correctly with Quarto CLI 1.3 (preview)
2 participants