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

Removing cache initialization during post_init as it is going to be d… #1622

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andromeda227799
Copy link

@Andromeda227799 Andromeda227799 commented Feb 17, 2025

…one in initialize() with the correct value from config.enable_cache

  • Closes #xxxx (Replace xxxx with the GitHub issue number).
  • Tests added and passed if fixing a bug or adding a new feature.
  • All code checks passed.

Important

Removes cache initialization from __post_init__ and moves it to initialize() in state.py, using config.enable_cache.

  • Behavior:
    • Removes cache initialization from __post_init__ in state.py.
    • Moves cache initialization to initialize() in state.py, using config.enable_cache to determine if cache should be created.
  • Misc:
    • Simplifies cache setup by centralizing it in initialize() function.

This description was created by Ellipsis for b387f10. It will automatically update as commits are pushed.

…one in initialize() with the correct value from config.enable_cache
@Andromeda227799
Copy link
Author

#1621 Issue fix

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to b387f10 in 54 seconds

More details
  • Looked at 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. pandasai/agent/state.py:45
  • Draft comment:
    Ensure removal of cache initialization from post_init doesn't leave AgentState without a cache when initialize() isn't called. Consider adding a comment noting that cache initialization has intentionally moved to initialize() to prevent confusion.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. pandasai/agent/state.py:68
  • Draft comment:
    Verify that unit tests cover cache initialization via initialize() (i.e., when config.enable_cache is True) since the behavior from post_init has been removed.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. pandasai/agent/state.py:47
  • Draft comment:
    Removed duplicate cache init in post_init—now handled in initialize() based on config.enable_cache. Ensure that users call initialize() to properly set up the cache, and consider documenting that a custom cache passed via the constructor will be overridden.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_yCHJ2qnqIiQ3D9gE


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@Andromeda227799
Copy link
Author

@gventuri We need this to be merged for our startup project, can you please expedite the release process?

Thanks in Advance!

@gventuri
Copy link
Collaborator

Hi @Andromeda227799 this does not seem to solve the issue, but rather it seem not initialize the cache at all. Unfortunately we cannot merge it like this. Please, feel free to address the actual issue and we'll be happy to merge it!

@Andromeda227799
Copy link
Author

@gventuri Isn't the Agent state supposed to be initialized in the initialize() function based on the flags

https://github.com/sinaptik-ai/pandas-ai/blob/main/pandasai/agent/state.py (Line 72)

@gventuri
Copy link
Collaborator

@Andromeda227799 good point, putting @ArslanSaleem in the loop, he's the most experience in the agent state

@shamith-atomicwork
Copy link

Hey @gventuri @ArslanSaleem any update on this?

@Arkajit-Datta
Copy link

@gventuri @ArslanSaleem Was facing the same exact issue. Please can we get it merged ASAP!

@chats-bug
Copy link

@ArslanSaleem I was facing the same issue while deploying in our servers. Mostly we have read only permissions, this really should be fixed quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants