Skip to content

[FIX] Sanitize plus signs in from entities in workflow names#3604

Merged
effigies merged 2 commits intonipreps:maint/25.2.xfrom
bpinsard:fix/bids-plus-char
Feb 6, 2026
Merged

[FIX] Sanitize plus signs in from entities in workflow names#3604
effigies merged 2 commits intonipreps:maint/25.2.xfrom
bpinsard:fix/bids-plus-char

Conversation

@bpinsard
Copy link
Collaborator

@bpinsard bpinsard commented Feb 6, 2026

Changes proposed in this pull request

Sanitize + char , now part of the BIDS spec , for instance in acq or task entities.

https://bids-specification.readthedocs.io/en/stable/glossary.html#label-formats

Without that fix, any use of + sign results in the following traceback

fmriprep/workflows/tests/test_base.py:271:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fmriprep/workflows/base.py:108: in init_fmriprep_wf
    single_subject_wf = init_single_subject_wf(subject_id, sessions, name=wf_name)
fmriprep/workflows/base.py:871: in init_single_subject_wf
    bold_wf = init_bold_wf(
fmriprep/workflows/bold/base.py:191: in init_bold_wf
    workflow = Workflow(name=_get_wf_name(bold_file, 'bold'))
../niworkflows/niworkflows/engine/workflows.py:47: in __init__
    super().__init__(name, base_dir)
../../../../.virtualenvs/nipreps_dev/lib/python3.10/site-packages/nipype/pipeline/engine/workflows.py:58: in __init__
    super().__init__(name, base_dir)
../../../../.virtualenvs/nipreps_dev/lib/python3.10/site-packages/nipype/pipeline/engine/base.py:35: in __init__
    self.name = name
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <[AttributeError("'LiterateWorkflow' object has no attribute '_id'") raised in repr()] LiterateWorkflow object at 0x79804fed4f40>
name = 'bold_task-rest_run-1_acquisition-mb4+pf68th_wf'

    @name.setter
    def name(self, name):
        if not name or not re.match(r"^[\w-]+$", name):
>           raise ValueError('[Workflow|Node] name "%s" is not valid.' % name)
E           ValueError: [Workflow|Node] name "bold_task-rest_run-1_acquisition-mb4+pf68th_wf" is not valid.

Documentation that should be reviewed

NA

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.29%. Comparing base (d1e486e) to head (2aae654).
⚠️ Report is 1 commits behind head on maint/25.2.x.

Additional details and impacted files
@@               Coverage Diff                @@
##           maint/25.2.x    #3604      +/-   ##
================================================
+ Coverage         73.21%   73.29%   +0.07%     
================================================
  Files                60       60              
  Lines              4838     4856      +18     
  Branches            628      630       +2     
================================================
+ Hits               3542     3559      +17     
- Misses             1156     1158       +2     
+ Partials            140      139       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bpinsard
Copy link
Collaborator Author

bpinsard commented Feb 6, 2026

fixes #3605

@bpinsard
Copy link
Collaborator Author

bpinsard commented Feb 6, 2026

Similar fixes might be required in smriprep or qsiprep.

Looks like tox style fails on something unrelated to this PR.

@miltoncamacho
Copy link
Contributor

LGTM

@effigies
Copy link
Member

effigies commented Feb 6, 2026

Looks good. Do you want to target the maint/25.2.x branch, so this can be fixed in the LTS?

@bpinsard bpinsard changed the base branch from master to maint/25.2.x February 6, 2026 19:05
@effigies effigies changed the title [FIX] sanitize plus + signs now part of the BIDS spec [FIX] Sanitize plus signs in from entities in workflow names Feb 6, 2026
@effigies effigies merged commit beae8e6 into nipreps:maint/25.2.x Feb 6, 2026
23 of 24 checks passed
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