-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix: deepcopy component output to avoid overriding previous outputs #3698
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
Also closes #3584 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Tested the Error Scenario and its fixed.
ToDo: to add integration/unit tests for this scenario in backlog
- Update loop to iterate over `_outputs.values()` instead of `outputs` to ensure correct attribute setting.
- Updated methods to iterate over `_outputs.values()` instead of `outputs`. - Ensured consistent access to output values across various methods. - Fixed potential issues with output value resetting and state model building.
- Updated all references of `_outputs` to `_outputs_map` in `component.py` to improve clarity and consistency. - Adjusted related methods and attributes in `base.py` to align with the new naming convention.
- Moved `_reset_all_output_values` call to ensure outputs are reset after initialization. - Updated attribute access to use `_outputs_map` instead of `_outputs` for consistency.
This was a bug that @edwinjosechittilappilly noticed in the linked issue. Outputs of subsequently created components were overriding outputs of previously created components of the same name - i.e. two Model outputs may interchange their
Outputs
, regardless of where in the flow they were.This is due to how the class variable
Outputs
is structured -- as class variables, it gives us this potential for cross-component leakage, but I have no better ideas at the moment on how to allow initializing the component with Outputs and then allowing for dynamic updates to that variable to provide theresult
.Closes #3619