Skip to content

Conversation

@huzech
Copy link
Contributor

@huzech huzech commented Jan 20, 2022

when use --single-step step2_tool parameter to run step in workflow meet this error

Traceback (most recent call last):
  File "/d/project/cwltool-main/cwltool/main.py", line 1181, in main
    ctool = choose_step(args, tool, loadingContext)
  File "/d/project/cwltool-main/cwltool/main.py", line 861, in choose_step
    extracted = get_step(tool, step_id, loading_context)
  File "/d/project/cwltool-main/cwltool/subgraph.py", line 225, in get_step
    name = outport.split("#")[-1].split("/")[-1]
AttributeError: 'CommentedMap' object has no attribute 'split'

@codecov
Copy link

codecov bot commented Jan 20, 2022

Codecov Report

Merging #1597 (1bea0d7) into main (318876b) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head 1bea0d7 differs from pull request most recent head 62745af. Consider uploading reports for the commit 62745af to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1597      +/-   ##
==========================================
- Coverage   66.29%   66.26%   -0.04%     
==========================================
  Files          93       93              
  Lines       16503    16509       +6     
  Branches     4378     4380       +2     
==========================================
- Hits        10941    10940       -1     
- Misses       4408     4415       +7     
  Partials     1154     1154              
Impacted Files Coverage Δ
cwltool/subgraph.py 80.60% <100.00%> (+0.35%) ⬆️
job.py 61.53% <0.00%> (-0.79%) ⬇️
subgraph.py 12.72% <0.00%> (-0.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 318876b...62745af. Read the comment docs.

Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mypy is failing. But it also worked when I tried a --single-step $param for a workflow.

$ cat /tmp/params.json 
{
  "file1": {
    "class": "File",
    "location": "/tmp/foo.txt"
  }
}
$ cwltool --debug --single-step step0 cwltool/schemas/v1.1/tests/count-lines11-extra-step-wf-noET.cwl /tmp/params.json
(...)
DEBUG Removing intermediate output directory /tmp/xrwwxp4z
DEBUG Removing intermediate output directory /tmp/7q408h7i
{
    "output": {
        "location": "file:///home/kinow/Development/python/workspace/cwltool/output",
        "basename": "output",
        "class": "File",
        "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
        "size": 0,
        "path": "/home/kinow/Development/python/workspace/cwltool/output"
    }
}
INFO Final process status is success

@huzech
Copy link
Contributor Author

huzech commented Jan 20, 2022

Thank your test! I use list steps format in cwl, it's not work, I'll try to fix it with both list and object formt step

class: Workflow
cwlVersion: v1.0
id: subgraph_wrokflow
label: subgraph_wrokflow
inputs:
  - id: input
    type: File?
    default:
      class: File
      path: /d/project/cwlsubgraphtest/1.txt
  - id: txt
    type: string?
    default: step1
  - id: txt_1
    type: string?
    default: step2
  - id: txt_2
    type: string?
    default: step3
outputs:
  - id: output1
    outputSource:
      - step1_tool/output1
    type: File
  - id: output4
    outputSource:
      - step3_tool/output1
    type: File
  - id: output2
    outputSource:
      - step2_tool/output1
    type: File
steps:
  - id: step1_tool
    in:
      - id: input
        source: input
      - id: txt
        default: step1
        source: txt
    out:
      - id: output1
      - id: output2
    run: ./add_txt_to_file.cwl
    label: add_txt_to_file
  - id: step2_tool
    in:
      - id: input
        source: step1_tool/output2
      - id: txt
        default: step2
        source: txt_1
    out:
      - id: output1
      - id: output2
    run: ./add_txt_to_file.cwl
    label: add_txt_to_file
  - id: step3_tool
    in:
      - id: input
        source: step2_tool/output2
      - id: txt
        default: step3
        source: txt_2
    out:
      - id: output1
      - id: output2
    run: ./add_txt_to_file.cwl
    label: add_txt_to_file
requirements: []

Copy link
Member

@mr-c mr-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @huzech for this. Can you add your test case to the PR so we can confirm the fix and prevent regressions in the future?

when use --single-step step2_tool parameter to run step in workflow meet this error
Traceback (most recent call last):
  File "/d/project/cwltool-main/cwltool/main.py", line 1181, in main
    ctool = choose_step(args, tool, loadingContext)
  File "/d/project/cwltool-main/cwltool/main.py", line 861, in choose_step
    extracted = get_step(tool, step_id, loading_context)
  File "/d/project/cwltool-main/cwltool/subgraph.py", line 225, in get_step
    name = outport.split("#")[-1].split("/")[-1]
AttributeError: 'CommentedMap' object has no attribute 'split'
@mr-c mr-c enabled auto-merge (squash) January 29, 2022 16:42
@mr-c mr-c merged commit 2c43c85 into common-workflow-language:main Jan 29, 2022
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.

3 participants