diff --git a/lida/components/executor.py b/lida/components/executor.py index 7be321096..35bed2b57 100644 --- a/lida/components/executor.py +++ b/lida/components/executor.py @@ -20,6 +20,8 @@ def preprocess_code(code: str) -> str: code = code.replace("", "") code = code.replace("", "") code = code.replace("", "") + code = code.replace(" import", "import") + code = code.replace(" def", "def") # remove all text after chart = plot(data) if "chart = plot(data)" in code: