These classes allow you to define a DB connection that marimo understands.
import pyarrow as pa
from typing import Any, Dict, List, Optional, Tuple, Union
class LogfireDBError(Exception):
"""Base exception for Logfire DB API errors"""
pass| # /// script | |
| # dependencies = [ | |
| # "marimo>=0.17.0", | |
| # "polars", | |
| # "pyzmq", | |
| # ] | |
| # /// | |
| import marimo |
| # /// script | |
| # dependencies = [ | |
| # "marimo>=0.17.0", | |
| # "polars", | |
| # "pyzmq", | |
| # ] | |
| # /// | |
| import marimo |
| # /// script | |
| # dependencies = [ | |
| # "marimo>=0.17.0", | |
| # "polars", | |
| # "pyzmq", | |
| # ] | |
| # /// | |
| import marimo |
| class Maybe: | |
| def __init__(self, obj): | |
| self._obj = obj | |
| def __getattr__(self, name): | |
| if self._obj is None: | |
| return Maybe(None) | |
| try: | |
| result = getattr(self._obj, name) | |
| return Maybe(result) |
| import pyarrow as pa | |
| from typing import Any, Dict, List, Optional, Tuple, Union | |
| class LogfireDBError(Exception): | |
| """Base exception for Logfire DB API errors""" | |
| pass | |
| class LogfireDBOperationalError(LogfireDBError): |
These classes allow you to define a DB connection that marimo understands.
import pyarrow as pa
from typing import Any, Dict, List, Optional, Tuple, Union
class LogfireDBError(Exception):
"""Base exception for Logfire DB API errors"""
pass| # /// script | |
| # requires-python = ">=3.12" | |
| # dependencies = [ | |
| # "marimo", | |
| # "polars[pyarrow]==1.33.1", | |
| # "python-dotenv==1.1.1", | |
| # "requests==2.32.5", | |
| # "sqlglot==27.17.0", | |
| # ] | |
| # /// |
I am a specialized AI assistant designed to help create data science notebooks using marimo. I focus on creating clear, efficient, and reproducible data analysis workflows with marimo's reactive programming model.
<assistant_info>
| /* Custom CSS for Marimo - Font customization */ | |
| /* Import Press Start 2P font from Google Fonts */ | |
| @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap'); | |
| :root { | |
| --marimo-monospace-font: 'Press Start 2P', 'Courier New', monospace; | |
| --marimo-text-font: 'Press Start 2P', 'Courier New', monospace; | |
| --marimo-heading-font: 'Press Start 2P', 'Courier New', monospace; | |
| } |
| import curses | |
| import time | |
| import random | |
| MAX_STARS = 50 | |
| STAR_CHARS = ['.', '*'] | |
| EXPLOSION_DURATION = 3 # Frames | |
| EXPLOSION_ART_PARTS = [ # New name, list of lists of (char, color_key) tuples | |
| [(' ', None), (' ', None), ('`', "exp_yellow"), ('*', "exp_yellow"), ('`', "exp_yellow"), (' ', None), (' ', None)], | |
| [(' ', None), ('*', "exp_dark_red"), ('X', "exp_yellow"), ('X', "exp_yellow"), ('X', "exp_yellow"), ('*', "exp_dark_red"), (' ', None)], |