-
Notifications
You must be signed in to change notification settings - Fork 340
Updating sql_to_kql and removing aiagents for Py3.13 compatibility #866
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
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.
Pull request overview
This pull request modernizes the codebase for Python 3.13 compatibility by removing the AI agents/RAG integration functionality and updating the SQL-to-KQL translation module to support mo-sql-parsing version 11+. The changes include dependency updates, modern type annotations using PEP 604 syntax, and enhanced test coverage.
Key changes:
- Complete removal of the
msticpy/aiagentspackage and its dependencies - Updated
mo-sql-parsingrequirement from version 8-9 to version 11-12 - Modernized type annotations throughout
sql_to_kql.pyusing PEP 604 union syntax (|instead ofUnion) - Enhanced SQL-to-KQL parser to handle new mo-sql-parsing v11+ formats, including
all_columnsfor SELECT *, union_all handling, and improved COUNT(DISTINCT) support - Added 25+ comprehensive test cases covering edge cases and various SQL operations
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
msticpy/aiagents/__init__.py |
Removed module docstring as part of aiagents deprecation |
msticpy/aiagents/config_utils.py |
Deleted entire file containing Autogen configuration utilities |
msticpy/aiagents/mp_docs_rag_magic.py |
Deleted entire file containing IPython magic commands for RAG |
msticpy/aiagents/rag_agents.py |
Deleted entire file containing RAG agent implementation |
tests/aiagents/test_rag_agents.py |
Deleted test file for removed RAG functionality |
setup.py |
Updated mo-sql-parsing version constraint to 11-12, removed aiagents extra, cleaned up file open calls |
requirements-all.txt |
Updated mo-sql-parsing version and removed autogen-agentchat dependency |
conda/conda-reqs-pip.txt |
Updated mo-sql-parsing version and removed autogen-agentchat dependency |
msticpy/data/sql_to_kql.py |
Modernized type annotations, enhanced parser for v11+ format support, improved union_all/COUNT(DISTINCT) handling, added all_columns support for SELECT * |
msticpy/data/core/query_source.py |
Removed unnecessary noqa comment from function signature |
msticpy/data/drivers/mordor_driver.py |
Removed unnecessary noqa comment from function signature |
tests/data/test_sql_to_kql.py |
Added raw string prefix for regex test, added 25+ comprehensive test cases covering SQL operators, joins, aggregations, and edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ithub.com/microsoft/msticpy into ianhelle/update_mo_sql_parsing-2025-12-08
ryan-detect-dot-dev
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.
LGTM
in resource_graph_driver.py
…ithub.com/microsoft/msticpy into ianhelle/update_mo_sql_parsing-2025-12-08
This pull request removes the AI agents and retrieval-augmented generation (RAG) integration code from the
msticpy/aiagentspackage, and updates the SQL-to-KQL translation logic to support newer versions ofmo-sql-parsing(version 11+). It also modernizes type annotations and improves the handling of SQL parsing edge cases. The most important changes are grouped below.AI Agents and RAG Integration Removal:
msticpy/aiagents/config_utils.py,msticpy/aiagents/mp_docs_rag_magic.py, andmsticpy/aiagents/rag_agents.py, effectively removing all AI agent and RAG magic functionality from the codebase. [1] [2] [3]msticpy/aiagents/__init__.py, signaling the deprecation of AI agent-related modules.SQL-to-KQL Translation Modernization:
conda/conda-reqs-pip.txtto requiremo-sql-parsingversion 11 or higher, ensuring compatibility with the latest features and syntax.msticpy/data/sql_to_kql.pyto use modern Python type annotations (PEP 604) and improved function signatures for readability and type safety. Also, clarified documentation to indicate support formo-sql-parsingversion 11+. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]sql_to_kql.pyto better handle union operations and new column formats, and added a note about PIVOT operations requiring additional handling. [1] [2] [3]Minor Code Quality Improvements:
# noqa: MC0001comments and cleaned up function signatures in several files for clarity and maintainability. [1] [2] [3]References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]