-
Notifications
You must be signed in to change notification settings - Fork 6
Reserved words handling + Support for data store selection #80
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
base: main
Are you sure you want to change the base?
Conversation
- Refactor reserved words implementation to follow official Snowflake documentation - Add support for quoting reserved words inside function calls (e.g., COUNT(DISTINCT account)) - Implement smart filtering to avoid quoting SQL keywords inappropriately - Add comprehensive test coverage including real-world VPC Flow logs scenarios - Maintain backward compatibility while improving query reliability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
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.
Looks mostly good just had a question
- Include complete lists of forbidden words in error messages to help LLMs learn - Add get_reserved_words_info() helper function for reference - Enhance docstring to document error message improvements - Maintain backward compatibility with existing error detection 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Resolves #78 |
Ok, this is looking ready. Summary of Reserved Word Testing Test Results: Query 1 - Initially failed with CURRENT_DATE (correctly caught as reserved), then succeeded when using explicit date Key Findings: The reserved word check is working - It correctly caught CURRENT_DATE and prevented its use |
- Add PANTHER_DATASTORE_TYPE environment variable (defaults to snowflake) - Implement automatic schema reference formatting (.public removal for Redshift) - Add datastore-specific reserved words handling - Update all SQL generation functions to be datastore-aware - Add comprehensive test coverage for both datastores - Update documentation in README.md, src/README.md, and CLAUDE.md 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add validation to require fully qualified table references (database.table format) - Implement automatic database reference conversion (.public removed for Redshift) - Add get_query_syntax_help() tool for datastore-specific guidance - Enhance SQL processing pipeline with conversion and validation steps - Add comprehensive test coverage for new functionality - Fix misleading documentation about automatic SQL syntax adaptation This enables users to write portable SQL queries that work across both Snowflake and Redshift datastores with automatic conversion handling schema differences. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add list_data_lake_queries() with comprehensive filtering options (status, date ranges, contains, pagination) - Add cancel_data_lake_query() to terminate long-running queries and prevent system overload - Include user vs API token issuer details and query timing information - Add comprehensive test coverage with 9 new test functions covering success, error, and edge cases - Enable proactive query management to diagnose and resolve performance bottlenecks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Replace Optional[T] with modern T | None syntax following fastmcp best practices - Add QueryStatus enum for type-safe status filtering - Add proper MCP tool annotations (readOnlyHint, destructiveHint) - Use regex patterns for ISO 8601 datetime validation - Simplify parameter annotations following metrics.py patterns - Remove redundant status validation (now handled by enum types) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🚀 Additional Updates Since Initial PRThis PR has been significantly enhanced with additional improvements beyond the original data lake query management functionality: 📊 New Data Lake Query Management Tools
🏗️ Enhanced Type Safety & Modern Annotations
🔍 Comprehensive Test Coverage
📋 GraphQL Schema Integration
⚡ Key Benefits
🎯 Common Use Cases# Find running queries that need attention
list_data_lake_queries(status=[QueryStatus.RUNNING])
# Monitor recent query activity
list_data_lake_queries(started_at_after="2024-01-01T00:00:00.000Z")
# Cancel problematic queries
cancel_data_lake_query("long-running-query-id") The implementation follows all fastmcp best practices and provides essential tools for managing data lake performance and preventing system overload. 🎉 |
Summary
COUNT(DISTINCT account)
)Test plan
🤖 Generated with Claude Code