Skip to content

Added separate executor#252

Merged
Simon Karan (SimonKaran13) merged 17 commits into
mainfrom
kosst/separate-executor
Apr 7, 2026
Merged

Added separate executor#252
Simon Karan (SimonKaran13) merged 17 commits into
mainfrom
kosst/separate-executor

Conversation

@kosstbarz
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 + SeparateGraph with run_sql_query/submit_result tools and a dedicated system prompt template.
  • Add SQLAlchemy-based Snowflake schema inspection (information_schema.tables/columns) to generate TableInfo/ColumnInfo for prompt schema.
  • Extend database adapter plumbing with try_create_sqlalchemy_engine() and a Snowflake create_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.

Comment thread databao/agent/databases/snowflake_adapter.py
Comment thread databao/agent/databases/snowflake_adapter.py
Comment thread databao/agent/executors/separate/separate_executor.py Outdated
Comment thread databao/agent/executors/separate/graph.py Outdated
Comment thread databao/agent/sqlalchemy/schema_inspection.py Outdated
Comment thread databao/agent/executors/separate/system_prompt.jinja Outdated
Comment thread databao/agent/executors/separate/system_prompt.jinja Outdated
@SokolovYaroslav
Copy link
Copy Markdown
Collaborator

Konstantin Barzilovich (@kosstbarz) please address the copilot's comments somehow :)

I personally don't look into the code until AI is happy

@SokolovYaroslav Yaroslav Sokolov (SokolovYaroslav) marked this pull request as draft March 23, 2026 11:27
@catstrike Lenar (catstrike) force-pushed the kosst/separate-executor branch from ca1d38d to 863a5c9 Compare April 2, 2026 00:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread databao/agent/executors/separate/separate_executor.py Outdated
Comment thread databao/agent/executors/separate/graph.py Outdated
Comment thread databao/agent/executors/separate/graph.py Outdated
Comment thread databao/agent/databases/snowflake_adapter.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread databao/agent/databases/snowflake_adapter.py
Comment thread databao/agent/executors/separate/separate_executor.py
Comment thread databao/agent/executors/separate/graph.py
…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>
@SimonKaran13 Simon Karan (SimonKaran13) merged commit 2da2f1a into main Apr 7, 2026
8 checks passed
@SimonKaran13 Simon Karan (SimonKaran13) deleted the kosst/separate-executor branch April 7, 2026 16:32
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