Bug #20462
closedUploading a new workflow is failing
Description
DEBUG EXIT mapper 1682618282.1297848 0.000244140625
DEBUG ENTER collectloc 1682618282.1298783
DEBUG EXIT collectloc 1682618282.132989 0.003110647201538086
DEBUG EXIT upload_dependencies wes-postalignment-tumor-only.cwl 1682618282.1488423 0.16721153259277344
DEBUG EXIT upload_workflow_deps 1682618282.1490312 15.242694616317749
ERROR Unhandled error:
string index out of range
Traceback (most recent call last):
File "/scratch/WES-Launcher-new/env/lib64/python3.7/site-packages/cwltool/main.py", line 1361, in main
tool, initialized_job_order_object, runtimeContext, logger=_logger
File "/scratch/WES-Launcher-new/env/lib64/python3.7/site-packages/arvados_cwl/executor.py", line 713, in arv_executor
jobmapper=jobmapper)
File "/scratch/WES-Launcher-new/env/lib64/python3.7/site-packages/arvados_cwl/arvworkflow.py", line 293, in upload_workflow
if f[n] != firstfile[n]:
IndexError: string index out of range
Updated by Peter Amstutz over 1 year ago
20462-workflow-prefix @ 7ac1e7337dca972ce93d04e5eccb6f4de9aed141
Updated by Brett Smith over 1 year ago
Would you accept this implementation that's O(n) instead of O(n²)? It passes all your tests.
def common_prefix(firstfile, all_files): common_parts = firstfile.split('/') common_parts[-1] = '' for f in all_files: f_parts = f.split('/') for index, (a, b) in enumerate(zip(common_parts, f_parts)): if a != b: common_parts = common_parts[:index + 1] common_parts[-1] = '' break if not any(common_parts): break return '/'.join(common_parts)
It seems like this function should be defined in cwl.util
. That's where you wrote the tests, and multiple modules are using it, and it's just a generic string manipulation function. How about moving it?
Updated by Peter Amstutz over 1 year ago
Brett Smith wrote in #note-4:
Would you accept this implementation that's O(n) instead of O(n²)? It passes all your tests.
[...]
This feels a bit like code golf but sure, I can use your implementation.
It seems like this function should be defined in
cwl.util
. That's where you wrote the tests, and multiple modules are using it, and it's just a generic string manipulation function. How about moving it?
Sure.
Updated by Peter Amstutz over 1 year ago
- Status changed from In Progress to Resolved