FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ENH: Add persisted run status CLI by basnijholt · Pull Request #938 · pipefunc/pipefunc · GitHub

ENH: Add persisted run status CLI - #938

Merged
basnijholt merged 9 commits into
mainfrom
feat/run-status-cli
Mar 6, 2026
Merged

ENH: Add persisted run status CLI#938
basnijholt merged 9 commits into
mainfrom
feat/run-status-cli

Conversation

basnijholt commented Mar 5, 2026
edited
Loading

Copy link
Copy Markdown
Collaborator

Summary

  • add a lightweight disk-backed run status helper that reads persisted run metadata without loading full inputs
  • add a JSON CLI with status, watch, and list-runs commands exposed as
  • reuse the shared run inspection code from the MCP helpers and cover the new CLI with tests

codecov Bot commented Mar 5, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
pipefunc/_run_status.py 100.00% <100.00%> (ø)
pipefunc/_run_status_cli.py 100.00% <100.00%> (ø)
pipefunc/_run_status_heartbeat.py 100.00% <100.00%> (ø)
pipefunc/map/_prepare.py 100.00% <100.00%> (ø)
pipefunc/map/_progress.py 100.00% <100.00%> (ø)
pipefunc/map/_run.py 100.00% <100.00%> (ø)
pipefunc/map/_run_eager_async.py 100.00% <ø> (ø)
pipefunc/map/_storage_array/_base.py 100.00% <100.00%> (ø)
pipefunc/map/_storage_array/_file.py 100.00% <100.00%> (ø)
pipefunc/mcp.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codspeed-hq Bot commented Mar 5, 2026
edited
Loading

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing feat/run-status-cli (e1d6d41) with main (bd93928)

while self._pipeline_task is not None and not self._pipeline_task.done():
await asyncio.sleep(self.heartbeat_interval_seconds)
self.write_now()
except asyncio.CancelledError:

Check notice

Code scanning / CodeQL

Empty except Note

'except' clause does nothing but pass and there is no explanatory comment.
Show autofix suggestion Hide autofix suggestion

Copilot Autofix

AI 6 months ago

In general, empty except blocks should either (a) perform some explicit handling (logging, cleanup, state updates), or (b) include a clear comment explaining why ignoring the exception is safe and intentional. This preserves debuggability and avoids accidentally hiding errors.

For this specific case, the best minimal fix without changing functionality is:

  • Keep swallowing asyncio.CancelledError (to avoid noisy tracebacks on expected cancellation).
  • Add a short comment explaining that cancellation is expected during normal shutdown and that no further action is necessary, so the coroutine simply exits.
  • Optionally, to make the intent even clearer, explicitly return from the coroutine in the except block. This does not change behavior but avoids a completely empty block.

Concretely:

  • In pipefunc/_run_status_heartbeat.py, in _heartbeat_loop, replace
74:     async def _heartbeat_loop(self) -> None:
75:         try:
76:             while self._pipeline_task is not None and not self._pipeline_task.done():
77:                 await asyncio.sleep(self.heartbeat_interval_seconds)
78:                 self.write_now()
79:         except asyncio.CancelledError:
80:             pass

with an implementation that includes an explanatory comment and exits the coroutine explicitly in the except block, preserving all existing behavior.

No new imports or helper functions are needed.

Suggested changeset 1
pipefunc/_run_status_heartbeat.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/pipefunc/_run_status_heartbeat.py b/pipefunc/_run_status_heartbeat.py
--- a/pipefunc/_run_status_heartbeat.py
+++ b/pipefunc/_run_status_heartbeat.py
@@ -77,7 +77,9 @@
                 await asyncio.sleep(self.heartbeat_interval_seconds)
                 self.write_now()
         except asyncio.CancelledError:
-            pass
+            # Expected during normal shutdown when the heartbeat task is cancelled.
+            # Swallow the cancellation to allow a clean exit without traceback.
+            return
 
     def _on_task_done(self, task: asyncio.Task[Any]) -> None:
         if self._heartbeat_task is not None:
EOF
@@ -77,7 +77,9 @@
await asyncio.sleep(self.heartbeat_interval_seconds)
self.write_now()
except asyncio.CancelledError:
pass
# Expected during normal shutdown when the heartbeat task is cancelled.
# Swallow the cancellation to allow a clean exit without traceback.
return

def _on_task_done(self, task: asyncio.Task[Any]) -> None:
if self._heartbeat_task is not None:
Copilot is powered by AI and may make mistakes. Always verify output.
basnijholt changed the title feat: add persisted run status CLI ENH: add persisted run status CLI Mar 5, 2026
basnijholt changed the title ENH: add persisted run status CLI ENH: Add persisted run status CLI Mar 6, 2026
basnijholt merged commit 0f1c980 into main Mar 6, 2026
21 checks passed
basnijholt deleted the feat/run-status-cli branch March 6, 2026 18:13

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

✅ PR Title Formatted Correctly

The title of this PR has been updated to match the correct format. Thank you!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL