Skip to content

Fix: Standardize parameter case handling in parser #50

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pankaj-bind
Copy link
Contributor

@pankaj-bind pankaj-bind commented Jul 9, 2025

Description

This pull request addresses an inconsistency in how parameter keys are handled across different AST nodes in the SQL parser.

The Problem:
The parser previously exhibited inconsistent behavior in handling the case of parameter keys within USING and SET clauses. While nodes like CreateKnowledgeBase and EvaluateKnowledgeBase normalized keys to lowercase, other nodes such as CreateSkill, CreateAgent, and CreateChatBot (and their UPDATE counterparts) did not. This could lead to unpredictable, case-sensitive behavior and potential bugs in downstream applications that expect consistent key names.

The Solution:
This PR standardizes parameter case handling by ensuring all parameter keys passed through USING and SET clauses are converted to lowercase. The normalization has been applied consistently to the parsing rules for the following commands:

  • CREATE AGENT / UPDATE AGENT
  • CREATE SKILL / UPDATE SKILL
  • CREATE CHATBOT / UPDATE CHATBOT

This change aligns their behavior with the existing implementation for KNOWLEDGE_BASE, ensuring that all parameter keys are case-insensitive.

Verification:
To validate the fix and prevent future regressions, a new test file has been added:

  • tests/test_mindsdb/test_case_handling.py

This file contains specific tests that create and update Agents, Skills, and Chatbots using mixed-case parameter keys and assert that they are correctly normalized to lowercase in the resulting AST.

Fix #49

@pankaj-bind
Copy link
Contributor Author

Hey @ea-rus, please review this PR.

@pankaj-bind
Copy link
Contributor Author

done

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.

[Bug]: Inconsistent Case Handling for Parameter Names in SQL Parser
2 participants