Skip to content

Commit b6dfd1e

Browse files
committed
Fix is_knitr_engine check for quarto == 1.8.26
closes #1017 ref: quarto-dev/quarto-cli#13613
1 parent 0da5f04 commit b6dfd1e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

doc/changelog.qmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ title: Changelog
1717

1818
- Fixed [](:class:`~plotnine.geom_smooth`) / [](:class:`~plotnine.stat_smooth`) when using a linear model via "lm" with weights for the model to do a weighted regression. This bug did not affect the formula API of the linear model. ({{< issue 1005 >}})
1919

20+
## v0.15.2
21+
(2025-12-12)
22+
23+
### Bug Fixes
24+
25+
- Fixed random failures for when using plotnine in quarto == 1.8.26. {{< issue 1017 >}}
26+
2027
## v0.15.1
2128
(2025-09-30)
2229

plotnine/_utils/quarto.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ def is_knitr_engine() -> bool:
4747
import json
4848
from pathlib import Path
4949

50-
info = json.loads(Path(filename).read_text())
51-
return info["format"]["execute"]["engine"] == "knitr"
50+
try:
51+
info = json.loads(Path(filename).read_text())
52+
except FileNotFoundError:
53+
# NOTE: Remove this branch some time after quarto 1.9 is released
54+
# https://github.com/quarto-dev/quarto-cli/issues/13613
55+
return "rpytools" in sys.modules
56+
return info["format"]["execute"].get("engine") == "knitr"
5257
else:
5358
# NOTE: Remove this branch some time after quarto 1.9 is released
5459
return "rpytools" in sys.modules

0 commit comments

Comments
 (0)