Updating sql_to_kql and removing aiagents for Py3.13 compatibility#866
Merged
Updating sql_to_kql and removing aiagents for Py3.13 compatibility#866
Conversation
Contributor
There was a problem hiding this comment.
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
in resource_graph_driver.py
…ithub.com/microsoft/msticpy into ianhelle/update_mo_sql_parsing-2025-12-08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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]