Skip to content

Commit e8a0b83

Browse files
laf070810Anfeng Lijohanneskoester
authored
fix: mtime of script or notebook not triggering workflow without metadata (#3148)
<!--Add a description of your PR here--> See #3014 (review) ### QC <!-- Make sure that you can tick the boxes below. --> * [ ] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [ ] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved logic for determining job execution conditions, ensuring accurate evaluations. - **Refactor** - Streamlined the `update_needrun` method for better readability and maintainability. - Consolidated checks for job metadata and conditions to eliminate redundancy. - **Style** - Minor adjustments to comments and formatting for enhanced clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Anfeng Li <[email protected]> Co-authored-by: Johannes Köster <[email protected]>
1 parent 2d08c63 commit e8a0b83

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

snakemake/dag.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,15 @@ async def update_needrun(job):
13081308
# for determining any other changes than file modification dates, as it will
13091309
# change after evaluating the input function of the job in the second pass.
13101310

1311+
# The list comprehension is needed below in order to
1312+
# collect all the async generator items before
1313+
# applying any().
1314+
reason.code_changed = any(
1315+
[
1316+
f
1317+
async for f in job.outputs_older_than_script_or_notebook()
1318+
]
1319+
)
13111320
if not self.workflow.persistence.has_metadata(job):
13121321
reason.no_metadata = True
13131322
else:
@@ -1322,15 +1331,7 @@ async def update_needrun(job):
13221331
self.workflow.persistence.input_changed(job)
13231332
)
13241333
if RerunTrigger.CODE in self.workflow.rerun_triggers:
1325-
# The list comprehension is needed below in order to
1326-
# collect all the async generator items before
1327-
# applying any().
1328-
reason.code_changed = any(
1329-
[
1330-
f
1331-
async for f in job.outputs_older_than_script_or_notebook()
1332-
]
1333-
) or any(
1334+
reason.code_changed |= any(
13341335
self.workflow.persistence.code_changed(job)
13351336
)
13361337
if (

0 commit comments

Comments
 (0)