Skip to content

Commit 66c5775

Browse files
committed
chore: make lint happy
Signed-off-by: Chojan Shang <psiace@apache.org>
1 parent badb9ef commit 66c5775

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

insights/schedule_kanban.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@
99
# "apscheduler",
1010
# ]
1111
# ///
12-
"""Scheduled tasks — rows from `apscheduler_jobs` (tapestore DB). Marimo: `?file=schedule_kanban.py`."""
12+
"""Scheduled tasks — rows from `apscheduler_jobs` (tapestore DB). Marimo: `?file=schedule_kanban.py`.
13+
14+
Marimo expects: PEP 723 block → docstring → `import marimo` → `app = mo.App(...)` with no other
15+
module-level code in between (otherwise the gateway may fail to attach a kernel).
16+
"""
1317

1418
import marimo as mo
1519

1620
app = mo.App(width="full")
1721

1822

1923
@app.cell
20-
def _():
24+
def _(): # noqa: C901
2125
import contextlib
2226
import os
2327
import pickle
@@ -29,7 +33,7 @@ def _():
2933

3034
_default_seekdb = "mysql+oceanbase://root:@127.0.0.1:2881/bub"
3135

32-
def _resolve_tapestore_like_gateway() -> str:
36+
def _resolve_tapestore_like_gateway() -> str: # noqa: C901
3337
"""Same DB as bubseek: env → workspace → repo .env (via __file__) → notebook_dir."""
3438
try:
3539
from bubseek.config import discover_project_root, resolve_tapestore_url
@@ -261,9 +265,8 @@ def _summarize_job_state(raw, pickle_mod) -> dict:
261265
md = MetaData()
262266
tbl = Table(table_name, md, autoload_with=engine)
263267
nulls_last = case((tbl.c.next_run_time.is_(None), 1), else_=0)
264-
stmt = (
265-
select(tbl.c.id, tbl.c.next_run_time, tbl.c.job_state)
266-
.order_by(nulls_last.asc(), tbl.c.next_run_time.asc())
268+
stmt = select(tbl.c.id, tbl.c.next_run_time, tbl.c.job_state).order_by(
269+
nulls_last.asc(), tbl.c.next_run_time.asc()
267270
)
268271
with engine.connect() as conn:
269272
result = conn.execute(stmt)
@@ -312,11 +315,7 @@ def _summarize_job_state(raw, pickle_mod) -> dict:
312315

313316
meta_html = f'<p class="sk-meta">{he(meta_line)}</p>' if meta_line else ""
314317

315-
thead = (
316-
"<thead><tr>"
317-
"<th>Id</th><th>Run at</th><th>Message</th>"
318-
"</tr></thead>"
319-
)
318+
thead = "<thead><tr><th>Id</th><th>Run at</th><th>Message</th></tr></thead>"
320319
body_rows = []
321320
for r in rows_out:
322321
body_rows.append(

0 commit comments

Comments
 (0)