ENH: persisting tasks on a per-run basis
維護者通常 4 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start with the making tasks persist tutorial and the existing @pytask.mark.persist behavior. Trace how task freshness and database updates are determined, then define the per-run override options and their effects on later executions. Done means the runtime API is documented, preserves existing defaults, and has tests for rerunning, marking updated, and leaving a task stale.
由索引模型根據 Issue 內容生成。
描述
Is your feature request related to a problem?
I'm taking about https://pytask-dev.readthedocs.io/en/stable/tutorials/making_tasks_persist.html
If I format my tasks.py file or update an unrelated task in there, then pytask will re-run the tasks. But I don't want this. I also don't want this to be a permanent feature of the task, as marked with a decorator.
Describe the solution you'd like
I want to be able to specify on a per-run basis whether or not to re-run a task if the source file changed. Ideally it should be something like
- Keep the @pytask.mark.persist as marking default behavior: If its not present, the default is to re-run on src changes. If it is present, then the default is to NOT re-run on source changes. Therefore, we don't break the old API.
- But, add a flag/API at runtime to override this default: On a per-task level be able to change the behavior. I the options should be "rerun", "don't rerun, and mark as updated", and "don't rerun, but don't mark as updated, so next time you run then the task will still appear stale". Maybe I'm not breaking down these options along the right axes, it could use more work.
API breaking implications
Per above, it shouldn't be breaking
Describe alternatives you've considered
Perhaps this warrants re-thinking the API for determining what is "up to date". Per those docs above:
Internally, the state of the dependencies, the source file, and the products are updated in the database such that the subsequent execution will skip the task successfully.
If we accumulate many more edge cases for when a task is up to date, things are going to get complicated. If there was a more official API when you define a task, eg @pytask.Task(func, ins, outs, *, should_run = None) and you could pass in (really brainstorming here)
- None (keep default behavior)
- True (rerun every time)
- A Callable[[Not sure what the args should be], bool]
- "on_dependency_change"
- "on_source_change"
- An Iterable of any of the above. If any are true, then rerun.
- 主要語言
- Python
- 星號
- 146
- 分支
- 14
- 平均合併
- 3 天 17 小時
- 30 天內合併 PR
- 23
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
pytask-dev/pytask 的其他 Issue
-
enhancement
難度 5/5 一週以上 新手友好度 45/100
pytask-dev/pytask#985 ·
維護者通常 4 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 30/100
pytask-dev/pytask#786 · 2 則留言 ·
維護者通常 4 天內回覆
-
bug
難度 3/5 1-2 天 新手友好度 42/100
pytask-dev/pytask#513 · 8 則留言 ·
維護者通常 4 天內回覆
-
enhancement
難度 5/5 一週以上 新手友好度 35/100
pytask-dev/pytask#503 · 1 則留言 · 1 個 reaction ·
維護者通常 4 天內回覆
-
enhancement
難度 4/5 3-5 天 新手友好度 35/100
pytask-dev/pytask#320 · 1 則留言 ·
維護者通常 4 天內回覆
查看 pytask-dev/pytask 的全部 Issue
相似的 Issue
-
json_params_matcher fails on falsy top-level JSON primitives (0, False, "")可能已有人在做 @mayureshsonawane17 今天認領。 未關閉Waiting for: Product Owner
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 5 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
bojieli/ai-agent-book#1169 ·
維護者通常 1 天內回覆
-
priority:low ready-for-dev
難度 2/5 1-3 小時 新手友好度 78/100
OpenHands/extensions#738 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 85/100
micronaut-projects/micronaut-core#13677 ·
維護者通常 1 天內回覆