ENH: persisting tasks on a per-run basis
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 146
- Forks
- 14
- Merge moyen
- 3 j 16 h
- PR mergées (30 j)
- 34
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de pytask-dev/pytask
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 45/100
pytask-dev/pytask#985 ·
-
ENH: a few design ideas Ouverteenhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
pytask-dev/pytask#786 · 2 commentaires ·
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 42/100
pytask-dev/pytask#513 · 8 commentaires ·
-
ENH: add some more common Nodes Ouverteenhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
pytask-dev/pytask#503 · 1 commentaire · 1 réaction ·
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
pytask-dev/pytask#320 · 1 commentaire ·
Toutes les issues de pytask-dev/pytask
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
OpenHands/extensions#626 · 1 commentaire ·
-
Change observation tooltip text Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
CSCfi/sd-search-api#39 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
please add to porn list Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
StevenBlack/hosts#3255 ·