-
Notifications
You must be signed in to change notification settings - Fork 2
DuckDB connections use ATTACH (only file based) #98
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
Conversation
mare5x
left a comment
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.
The code is much more understandable now that Executor handles the connection and not Session :)
| if isinstance(connection, duckdb.DuckDBPyConnection): | ||
| path = get_db_path(connection) | ||
| if path is not None: | ||
| connection.close() |
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.
Do we need to close()? What if the user wants to keep using the connection outside databao?
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.
It is difficult to work with DuckDB. At least for me. I started with no close(), but it failed because during connection creation relative path could be used. But we can use only full path. In this case DuckDB raises an error, that the same file is connected with different path. So the only way I found to work around was to close the connection. It would be great if you find better solution.
| self._cached_graph: ExecuteSubmit | None = None | ||
| self._prompt_template = read_prompt_template(Path("system_prompt.jinja")) | ||
|
|
||
| # Create a DuckDB connection for the agent |
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.
Copying the comment from #100 since it's relevant here. We can leave the code as-is for now though.
With the current design, Executor gets a Session in execute so it should technically work with many Sessions. So if the Executor wants to cache the system prompt (or anything else), it needs to keep track to which Session the prompt belongs.
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.
Let's keep it for now. We have a point to discuss on design review. Then we will fix it in the separate PR.
Uh oh!
There was an error while loading. Please reload this page.