Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: prompt pandas installation instead of polars when duckdb parsing fails (#4905)

Shahmir Varqhad524eb9b2a20
diff --git a/marimo/_sql/engines/duckdb.py b/marimo/_sql/engines/duckdb.py
index ea140adc07..e5de4d98ab 100644
--- a/marimo/_sql/engines/duckdb.py
+++ b/marimo/_sql/engines/duckdb.py
@@ -67,10 +67,12 @@ class DuckDBEngine(SQLEngine):
try:
return relation.pl()
- except (pl.exceptions.PanicException, pl.exceptions.ComputeError):
- LOGGER.info(
- "Failed to convert to polars, falling back to pandas"
- )
+ except (
+ pl.exceptions.PanicException,
+ pl.exceptions.ComputeError,
+ ) as e:
+ LOGGER.warning("Failed to convert to polars. Reason: %s.", e)
+ DependencyManager.pandas.require("to convert this data")
if DependencyManager.pandas.has():
try: