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.

Make output/std stream max sizes configurable (#498)

Akshay Agrawalb4ba3ca5c072
diff --git a/marimo/_messaging/streams.py b/marimo/_messaging/streams.py
index 7e8c2b073d..14324e3a18 100644
--- a/marimo/_messaging/streams.py
+++ b/marimo/_messaging/streams.py
@@ -1,6 +1,7 @@
# Copyright 2023 Marimo. All rights reserved.
from __future__ import annotations
+import os
import sys
import threading
from collections import deque
@@ -33,10 +34,10 @@ LOGGER = _loggers.marimo_logger()
# In any case, it's better than breaking the frontend/kernel.
#
# Output not shown if larger than OUTPUT_MAX_BYTES=5MB
-OUTPUT_MAX_BYTES = 5_000_000
+OUTPUT_MAX_BYTES = int(os.getenv("MARIMO_OUTPUT_MAX_BYTES", 5_000_000))
# Standard stream truncated if larger than STD_STREAM_MAX_BYTES=1MB
-STD_STREAM_MAX_BYTES = 1_000_000
+STD_STREAM_MAX_BYTES = int(os.getenv("MARIMO_STD_STREAM_MAX_BYTES", 1_000_000))
class Stream: