Added separate executor#252
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “separate” execution mode that runs SQL directly against each datasource’s native SQLAlchemy engine (instead of routing through DuckDB), including Snowflake engine creation and schema introspection to populate the system prompt.
Changes:
- Introduce
SeparateExecutor+SeparateGraphwithrun_sql_query/submit_resulttools and a dedicated system prompt template. - Add SQLAlchemy-based Snowflake schema inspection (
information_schema.tables/columns) to generateTableInfo/ColumnInfofor prompt schema. - Extend database adapter plumbing with
try_create_sqlalchemy_engine()and a Snowflakecreate_sqlalchemy_engine()implementation.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| databao/agent/sqlalchemy/schema_inspection.py | New SQLAlchemy schema inspector (currently Snowflake-only) producing TableInfo/ColumnInfo. |
| databao/agent/sqlalchemy/init.py | Initializes databao.agent.sqlalchemy package. |
| databao/agent/executors/separate/system_prompt.jinja | New system prompt template for the separate executor (includes Snowflake quoting guidance). |
| databao/agent/executors/separate/separate_executor.py | New executor that builds per-datasource SQLAlchemy engines and injects schema into the prompt. |
| databao/agent/executors/separate/graph.py | New LangGraph tool loop to run SQL via SQLAlchemy engines and submit results. |
| databao/agent/databases/snowflake_adapter.py | Adds Snowflake SQLAlchemy engine creation from connection config (password/keypair/SSO). |
| databao/agent/databases/databases.py | Adds try_create_sqlalchemy_engine() helper to delegate engine creation to adapters. |
| databao/agent/databases/database_adapter.py | Adds optional create_sqlalchemy_engine() hook on adapters (default None). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Konstantin Barzilovich (@kosstbarz) please address the copilot's comments somehow :) I personally don't look into the code until AI is happy |
… additional properties
ca1d38d to
863a5c9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 13 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…comma in Snowflake OAuth example.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 13 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ly SQL, add tests - Add TOKEN_KEY to AUTH_KEYS to prevent OAuth token from leaking into additional_properties via create_config_from_runtime - Add _validate_read_only() to reject DDL/DML in run_sql_query - Add tests/test_separate_executor.py covering executor init, schema inspection, and SQL validation - Add test for TOKEN_KEY exclusion in test_snowflake_adapter.py Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No description provided.