posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.82k stars 91 forks source link

Quarto fails to execute malformed python chunks #4459

Open gshotwell opened 3 months ago

gshotwell commented 3 months ago

System details:

M3 Mac

Positron and OS details:

Positron Version: 2024.08.0 (Universal) build 31 Code - OSS Version: 1.91.0 Commit: 7ee0596b81d578059e63c9af7c535c6b6040b947 Date: 2024-08-10T14:49:10.180Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 23.6.0#### Interpreter details:

Python 3.12

Describe the issue:

Malformed python code blocks fail to error when executing in positron.

Steps to reproduce the issue:

When you run this code, the console doesn't execute the code and issue an error but instead prints the code to the console. The code has a mistake in it (positional following keyword argument).

from plotnine import *
from palmerpenguins import load_penguins
import polars as pl
df = pl.from_pandas(load_penguins())

(ggplot(df, aes(x = "bill_length_mm", "bill_depth_mm", colour = "species")) + geom_point() + theme_minimal())

Expected or desired behavior:

The code should execute and error.

Were there any error messages in the UI, Output panel, or Developer Tools console?

juliasilge commented 2 months ago

This is related to #1646 and especially https://github.com/posit-dev/positron/issues/1646#issuecomment-2135993785, because the Quarto executors for Python currently go through Jupyter, instead of the Positron statement range provider.

As of today, if you manually (i.e. copy and paste) execute the lines separately, you do get the better behavior:

executor

The console is behaving as expected but seems like the Jupyter executor is not the best option, even for Python users.