Skip to content

fix: loop variable not accessible error #7501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Apr 10, 2025

Conversation

edwinjosechittilappilly
Copy link
Collaborator

This pull request includes several changes to improve the handling of loop components and edge parameters in the Langflow backend. The most important changes include updating the aggregated_output method, adding comments for better code understanding, and modifying the loop template JSON.

Improvements to loop component:

Code comments for clarity:

Loop template JSON update:

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 8, 2025
@dosubot dosubot bot added the bug Something isn't working label Apr 8, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • src/backend/base/langflow/initial_setup/starter_projects/LoopTemplate.json: Language not supported
Comments suppressed due to low confidence (1)

src/backend/base/langflow/graph/vertex/base.py:310

  • [nitpick] Consider rephrasing this comment for improved clarity, e.g., 'When executing the loop, assign the param_key item after validation.'
#  if the loop is run the param_key item will be set over here

Comment on lines +74 to +75
# If the param_key is in the output_names, it means that the loop is run
# if the loop is run the param_key item will be set over here
Copy link
Preview

Copilot AI Apr 8, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment is awkwardly phrased; consider rewording it for clarity, for example: 'If param_key is in output_names, then the loop is executing.'

Suggested change
# If the param_key is in the output_names, it means that the loop is run
# if the loop is run the param_key item will be set over here
# If param_key is in output_names, then the loop is executing,
# and the param_key item will be set here.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

@@ -719,6 +719,7 @@ async def _run(self):

def __getattr__(self, name: str) -> Any:
if "_attributes" in self.__dict__ and name in self.__dict__["_attributes"]:
# _attributes is a dict of attributes that are not inputs or outputs all the raw data it should have the item.
Copy link
Preview

Copilot AI Apr 8, 2025

Choose a reason for hiding this comment

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

[nitpick] The comment is unclear and grammatically incorrect; consider rewording it to something like: 'The _attributes dictionary holds additional raw data not included in inputs or outputs.'

Suggested change
# _attributes is a dict of attributes that are not inputs or outputs all the raw data it should have the item.
# The _attributes dictionary holds additional raw data not included in inputs or outputs.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Apr 8, 2025
@edwinjosechittilappilly
Copy link
Collaborator Author

@ogabrielluiz Note:

_set_params_from_normal_edge in vertex base is not used since we have a ParameterHandler class.
Hence updated the _set_params_from_normal_edge to handle loop inputs

@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Apr 8, 2025
…AI_API_KEY" to "ANTHROPIC_API_KEY" in order to reflect the correct API key being used
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Apr 8, 2025
Copy link
Member

@Cristhianzl Cristhianzl left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 8, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Apr 8, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Apr 8, 2025
@github-actions github-actions bot added the bug Something isn't working label Apr 10, 2025
ogabrielluiz and others added 4 commits April 10, 2025 13:23
…erence

Changed the URL in the test case from "Artificial_intelligence" to "Human_intelligence" to ensure accurate testing of the loop component functionality.
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Apr 10, 2025
@lucaseduoli lucaseduoli added lgtm This PR has been approved by a maintainer and removed lgtm This PR has been approved by a maintainer labels Apr 10, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Apr 10, 2025
@Cristhianzl Cristhianzl disabled auto-merge April 10, 2025 17:34
@Cristhianzl Cristhianzl enabled auto-merge April 10, 2025 17:34
@Cristhianzl Cristhianzl disabled auto-merge April 10, 2025 17:34
@Cristhianzl Cristhianzl removed the lgtm This PR has been approved by a maintainer label Apr 10, 2025
@Cristhianzl Cristhianzl added the lgtm This PR has been approved by a maintainer label Apr 10, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Apr 10, 2025
Copy link

codspeed-hq bot commented Apr 10, 2025

CodSpeed Performance Report

Merging #7501 will degrade performances by 47.05%

Comparing fix-loop-execution (4f73d19) with main (cf16595)

Summary

❌ 2 regressions
✅ 17 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_build_flow_invalid_job_id 9.5 ms 18 ms -47.05%
test_cancel_nonexistent_build 8.9 ms 14 ms -36.34%

@edwinjosechittilappilly edwinjosechittilappilly added this pull request to the merge queue Apr 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 10, 2025
@edwinjosechittilappilly edwinjosechittilappilly added this pull request to the merge queue Apr 10, 2025
Merged via the queue into main with commit e135b7f Apr 10, 2025
38 checks passed
@edwinjosechittilappilly edwinjosechittilappilly deleted the fix-loop-execution branch April 10, 2025 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants