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

_additional_dependencies not change in retrying with a correction framework #1425

Open
gDanzel opened this issue Nov 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gDanzel
Copy link

gDanzel commented Nov 5, 2024

System Info

OS version: WIN11
Python version: 3.12
The current version of pandasai being used: 2.3.0

🐛 Describe the bug

In retrying correction framework, the code changes in import dependencies, not reflected in the code running environment.

The issue is in execute method of code_execution.py,

at line 71 in execution method, self._additional_dependencies only been assigned value here and never been changed:
self._additional_dependencies = self.context.get("additional_dependencies", [])

thus in the susequent while loop, at line 83, even it refreshed code runing environment, but since self._additional_dependencies not change, the enviroment not change.

        ......
        while retry_count <= self.context.config.max_retries:
            try:
                result = self.execute_code(code_to_run, code_context)
        ......

This is a bug to be fixed.

Copy link

dosubot bot commented Nov 5, 2024

The issue you're encountering is that the self._additional_dependencies variable is not updated during the retry process in the execute method, which means that any changes in import dependencies are not reflected in the code running environment. This is because self._additional_dependencies is only set once at the beginning and not updated in subsequent retries.

To address this, you would need to ensure that self._additional_dependencies is updated with any new dependencies before each retry. This could involve re-fetching the dependencies from the context or modifying the retry logic to account for changes in dependencies. Unfortunately, the current implementation does not include a mechanism to update self._additional_dependencies during retries, which is why the environment does not change as expected [1].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the bug Something isn't working label Nov 5, 2024
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

No branches or pull requests

1 participant