Skip to content

Commit

Permalink
fix: show queries of remote storage files instead of local paths in s…
Browse files Browse the repository at this point in the history
…ummary (#2860)

<!--Add a description of your PR here-->

### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] 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).
  • Loading branch information
johanneskoester committed May 3, 2024
1 parent dd53319 commit ba1db8e
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions snakemake/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2413,6 +2413,11 @@ def html_node(node_id, node, color):
).format(items="\n".join(nodes + edges))

async def summary(self, detailed=False):
def fmt_output(f):
if f.is_storage:
return f.storage_object.query
return f

if detailed:
yield "output_file\tdate\trule\tlog-file(s)\tinput-file(s)\tshellcmd\tstatus\tplan"
else:
Expand All @@ -2434,8 +2439,8 @@ async def summary(self, detailed=False):
log = self.workflow.persistence.log(f)
log = "-" if log is None else ",".join(log)

input = self.workflow.persistence.input(f)
input = "-" if input is None else ",".join(input)
inputfiles = self.workflow.persistence.input(f)
inputfiles = "-" if inputfiles is None else ",".join(inputfiles)

shellcmd = self.workflow.persistence.shellcmd(f)
shellcmd = "-" if shellcmd is None else shellcmd
Expand All @@ -2462,10 +2467,19 @@ async def summary(self, detailed=False):
status = "params changed"
if detailed:
yield "\t".join(
(f, date, rule, log, input, shellcmd, status, pending)
(
fmt_output(f),
date,
rule,
log,
inputfiles,
shellcmd,
status,
pending,
)
)
else:
yield "\t".join((f, date, rule, log, status, pending))
yield "\t".join((fmt_output(f), date, rule, log, status, pending))

def archive(self, path: Path):
"""Archives workflow such that it can be re-run on a different system.
Expand Down

0 comments on commit ba1db8e

Please sign in to comment.