Skip to content
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

feat: add vertices_being_run set to RunnableVerticesManager #2589

Merged
merged 7 commits into from
Jul 8, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This commit adds a new set called vertices_being_run to the RunnableVerticesManager class. This set keeps track of vertices that are currently running. The purpose of this set is to prevent a vertex from being considered runnable if it is already being run.

…ng edges to predecessor and successor maps in Graph class
…he set and updating the predecessor map in the Graph class
…to vertices_ids set

refactor(graph/base.py): fix indentation for predecessor_map and successor_map dictionaries to improve code readability
This commit adds a new set called `vertices_being_run` to the `RunnableVerticesManager` class. This set keeps track of vertices that are currently running. The purpose of this set is to prevent a vertex from being considered runnable if it is already being run.

Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 8, 2024
@dosubot dosubot bot added the enhancement New feature or request label Jul 8, 2024
Copy link
Contributor

github-actions bot commented Jul 8, 2024

Pull Request Validation Report

This comment is automatically generated by Conventional PR

Whitelist Report

Whitelist Active Result
Pull request is a draft and should be ignored
Pull request is made by a whitelisted user and should be ignored
Pull request is submitted by a bot and should be ignored
Pull request is submitted by administrators and should be ignored

Result

Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated.

Validation Report

Validation Active Result
All commits in this pull request has valid messages
Pull request does not introduce too many changes
Pull request has a valid title
Pull request has mentioned issues
Pull request has valid branch name
Pull request should have a non-empty body

Result

Pull request satisfies all enabled pull request rules.

Last Modified at 08 Jul 24 19:18 UTC

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 8, 2024
This commit updates the logic for retrieving the vertices to run in the `retrieve_vertices_order` function in `chat.py`. The previous implementation used the `list` function to convert the `vertices_to_run` set to a list and then concatenated it with the result of the `get_top_level_vertices` function. The updated logic uses the `union` method to combine the two sets directly. This change improves the efficiency and readability of the code.
…he set and updating the predecessor map in the Graph class
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 8, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 8, 2024
@ogabrielluiz ogabrielluiz merged commit 38b10b0 into main Jul 8, 2024
27 checks passed
@ogabrielluiz ogabrielluiz deleted the fix_state_ordering branch July 8, 2024 20:48
ogabrielluiz added a commit to yaitec/langflow that referenced this pull request Jul 9, 2024
…-ai#2589)

* refactor(base.py): remove unnecessary conditional statements for adding edges to predecessor and successor maps in Graph class

* refactor(graph/base.py): optimize the process of adding vertices to the set and updating the predecessor map in the Graph class

* refactor(graph/base.py): remove unnecessary line that adds vertex_id to vertices_ids set
refactor(graph/base.py): fix indentation for predecessor_map and successor_map dictionaries to improve code readability

* feat: Add vertices_being_run set to RunnableVerticesManager

This commit adds a new set called `vertices_being_run` to the `RunnableVerticesManager` class. This set keeps track of vertices that are currently running. The purpose of this set is to prevent a vertex from being considered runnable if it is already being run.

Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>

* chore: Remove unnecessary vertex from next_runnable_vertices in RunnableVerticesManager

* feat: Update vertices_to_run logic in retrieve_vertices_order function

This commit updates the logic for retrieving the vertices to run in the `retrieve_vertices_order` function in `chat.py`. The previous implementation used the `list` function to convert the `vertices_to_run` set to a list and then concatenated it with the result of the `get_top_level_vertices` function. The updated logic uses the `union` method to combine the two sets directly. This change improves the efficiency and readability of the code.

* refactor(graph/base.py): optimize the process of adding vertices to the set and updating the predecessor map in the Graph class
nicoloboschi pushed a commit to datastax/ragstack-ai-langflow that referenced this pull request Jul 10, 2024
…-ai#2589)

* refactor(base.py): remove unnecessary conditional statements for adding edges to predecessor and successor maps in Graph class

* refactor(graph/base.py): optimize the process of adding vertices to the set and updating the predecessor map in the Graph class

* refactor(graph/base.py): remove unnecessary line that adds vertex_id to vertices_ids set
refactor(graph/base.py): fix indentation for predecessor_map and successor_map dictionaries to improve code readability

* feat: Add vertices_being_run set to RunnableVerticesManager

This commit adds a new set called `vertices_being_run` to the `RunnableVerticesManager` class. This set keeps track of vertices that are currently running. The purpose of this set is to prevent a vertex from being considered runnable if it is already being run.

Co-authored-by: Gabriel Luiz Freitas Almeida <[email protected]>

* chore: Remove unnecessary vertex from next_runnable_vertices in RunnableVerticesManager

* feat: Update vertices_to_run logic in retrieve_vertices_order function

This commit updates the logic for retrieving the vertices to run in the `retrieve_vertices_order` function in `chat.py`. The previous implementation used the `list` function to convert the `vertices_to_run` set to a list and then concatenated it with the result of the `get_top_level_vertices` function. The updated logic uses the `union` method to combine the two sets directly. This change improves the efficiency and readability of the code.

* refactor(graph/base.py): optimize the process of adding vertices to the set and updating the predecessor map in the Graph class

(cherry picked from commit 38b10b0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants