fix: Simplify loop stopping condition to prevent off-by-one errors (#6696)

* 🐛 (loop.py): Fix logic in LoopComponent to correctly evaluate if loop should stop based on current index and data length
📝 (LoopTemplate.json): Update output_types to be arrays for consistency and readability in LoopTemplate JSON file

* 🐛 (loop.py): fix logic in stop condition to correctly evaluate if loop should stop or continue based on current index and data length

* [autofix.ci] apply automated fixes

* ✅ (loop-component.spec.ts): update test expectation to match the correct number of occurrences of "modified_value" in the output

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
Cristhian Zanforlin Lousa 2025-02-19 21:20:23 -03:00 • committed by GitHub
commit af2d77d886
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -237,6 +237,6 @@ test(
// Count occurrences of modified_value in output
const matches = output?.match(/modified_value/g) || [];
expect(matches).toHaveLength(2);
expect(matches).toHaveLength(1);
},
);