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: col names missing for chdb (#4355)

Shahmir Varqha5ec68074a0b3
diff --git a/marimo/_sql/engines/clickhouse.py b/marimo/_sql/engines/clickhouse.py
index 33de700739..b864568c29 100644
--- a/marimo/_sql/engines/clickhouse.py
+++ b/marimo/_sql/engines/clickhouse.py
@@ -62,14 +62,14 @@ class ClickhouseEmbedded(SQLEngine):
# TODO: this will fail weirdly / silently when there is another connection
+ # Do not catch exceptions here or it may silently fail
if self._cursor:
- try:
- self._cursor.execute(query)
- rows = self._cursor.fetchall()
- return pd.DataFrame(rows)
- except Exception:
- LOGGER.exception("Failed to execute query")
- return None
+ self._cursor.execute(query)
+ rows = self._cursor.fetchall()
+ col_names = self._cursor.column_names()
+ # col_types = self._cursor.column_types()
+
+ return pd.DataFrame(rows, columns=col_names)
try:
result = chdb.query(query, "Dataframe")