Skip to content

Keep 0 and False in concat merge outputs - #1323

Merged
davidmezzetti merged 1 commit into
neuml:masterfrom
Lesereingrape:fix/concat-merge-falsy-values-1003
Oct 4, 2026
Merged

davidmezzetti merged 1 commit into
neuml:masterfrom
Lesereingrape:fix/concat-merge-falsy-values-1003

Conversation

@Lesereingrape

Copy link
Copy Markdown
Contributor

What / why

Task.concat merged multi-action outputs with a truthiness filter (if y), so a 0, 0.0 or False result was dropped from the merged string instead of being written into it:

task = Task([lambda x: [0, 5], lambda x: ["Widget", "Gadget"]], merge="concat")
list(task([1, 2]))
# before: ['Widget', '5. Gadget']
# after:  ['0. Widget', '5. Gadget']

A quantity of 0 is real data. Only None and "" contribute nothing but a separator, so the guard now skips exactly those - the same rule the tabular pipeline already applies in Tabular.concat (column is not None and column != "", covered by testFalsyValues).

Closes #1322

Checks

test/python/testworkflow.py on Python 3.11, base 893d042:

  • new testMergeWorkflowFalsyValues fails on base with AssertionError: Lists differ: ['Widget', '5. Gadget'] != ['0. Widget', '5. Gadget'] and passes with this change
  • merge coverage stays green: testMergeWorkflow, testMergeUnbalancedWorkflow and testIteratorActions (which loops over hstack/vstack/concat/None)
  • whole module: 6 failed, 35 passed with this change vs 6 failed, 34 passed on a base checkout of the same environment - the 6 failures are the identical set of pre-existing local gaps (optional pipeline/workflow extras not installed, image model), none is an assertion in the merge path
  • black --check clean, pylint 10.00/10 with the repo .pylintrc
  • numpy/torch path checked directly: np.stack rows give scalars, and np.float64(0.0) != "" returns np.bool_ without warnings under -W error::DeprecationWarning, so array merges keep working (['0.0. 1.0', '5.0. 6.0'])

Note

AI-assisted: this change was drafted and verified locally with an AI coding assistant (reproduction, RED/GREEN runs and lint above).

@davidmezzetti davidmezzetti added the bug Something isn't working label Oct 4, 2026
@davidmezzetti davidmezzetti added this to the v9.14.0 milestone Oct 4, 2026
@davidmezzetti

Copy link
Copy Markdown
Member

LGTM - Thank you!

@davidmezzetti
davidmezzetti merged commit 3265539 into neuml:master Oct 4, 2026
4 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

concat merge drops 0 and False from task results

2 participants