Thank you for your interest in contributing to the Text2SQL Evaluation Toolkit! This document provides guidelines for contributing to the project. Our project welcomes external contributions. If you have an itch, please feel free to scratch it.
To contribute code or documentation, please submit a pull request.
A good way to familiarize yourself with the codebase and contribution process is to look for and tackle low-hanging fruit in the issue tracker. Before embarking on a more ambitious contribution, please quickly get in touch with us.
Note: We appreciate your effort, and want to avoid a situation where a contribution requires extensive rework (by you or by us), sits in backlog for a long time, or cannot be accepted at all!
If you would like to implement a new feature, please raise an issue before sending a pull request so the feature can be discussed. This is to avoid you wasting your valuable time working on a feature that the project developers are not interested in accepting into the code base.
If you would like to fix a bug, please raise an issue before sending a pull request so it can be tracked.
The project maintainers use LGTM (Looks Good To Me) in comments on the code review to indicate acceptance. A change requires LGTMs from two of the maintainers of each component affected.
For a list of the maintainers, see the MAINTAINERS.md page.
This project follows the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
Each source file must include a license header for the Apache Software License 2.0. Using the SPDX format is the simplest approach. e.g.
#
# Copyright IBM Corp. 2025 - 2025
# SPDX-License-Identifier: Apache-2.0
#
We have tried to make it as easy as possible to make contributions. This applies to how we handle the legal aspects of contribution. We use the same approach - the Developer's Certificate of Origin 1.1 (DCO) - that the Linux® Kernel community uses to manage code contributions.
We simply ask that when submitting a patch for review, the developer must include a sign-off statement in the commit message.
Here is an example Signed-off-by line, which indicates that the submitter accepts the DCO:
Signed-off-by: John Doe <john.doe@example.com>
You can include this automatically when you commit a change to your local git repository using the following command:
git commit -s
Please feel free to connect with us by opening an issue in the issue tracker.
- Python 3.11 or higher
- Git
# Clone your fork
git clone https://github.com/YOUR_USERNAME/text2sql-eval-toolkit.git
cd text2sql-eval-toolkit
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode with all dependencies
pip install -e ".[db2,mysql,presto]"
# Install development dependencies
pip install pytest black ruff mypy# Run all tests
pytest
# Run tests with coverage
pytest --cov=src/text2sql_eval_toolkit
# Run specific test file
pytest tests/test_evaluation.pyWe follow these coding standards:
-
Formatting: Use Black for code formatting
black src/ tests/
-
Linting: Use Ruff for linting
ruff check src/ tests/
-
Type Hints: Add type hints to function signatures
-
Docstrings: Use Google-style docstrings for functions and classes
-
Line Length: Maximum 88 characters (Black default)
text2sql-eval-toolkit/
├── src/text2sql_eval_toolkit/ # Main package
│ ├── evaluation/ # Evaluation metrics
│ ├── execution/ # SQL execution
│ ├── inference/ # LLM inference
│ ├── profiling/ # Query profiling
│ └── analysis/ # Results analysis
├── scripts/ # Utility scripts
├── data/ # Benchmarks and results
├── tests/ # Test suite
└── notebooks/ # Example notebooks
- Create benchmark JSON file in
data/benchmarks/ - Create schema JSON file in
data/benchmarks/ - Add entry to
data/benchmarks.json(for full benchmarks) ordata/test-benchmarks.json(for test/development benchmarks) - Update documentation
Note: Test benchmarks should be smaller subsets (3-50 questions) suitable for quick validation and CI/CD pipelines. Place test benchmark data files in data/benchmarks/test_benchmarks/.
- Add metric function to
src/text2sql_eval_toolkit/evaluation/evaluation_tools.py - Add tests in
tests/test_evaluation.py - Update documentation
- Add example usage in notebooks
- Add connection logic to
src/text2sql_eval_toolkit/execution/execution_tools.py - Add optional dependencies to
pyproject.toml - Update
env.examplewith required environment variables - Add tests for the new database type
- Update README with setup instructions
- Write unit tests for new functions
- Write integration tests for end-to-end workflows
- Use fixtures for common test data
- Mock external services (LLM APIs, databases) when appropriate
- Aim for >80% code coverage
Follow the Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(evaluation): add F1 score metric for SQL comparison
fix(execution): handle NULL values in MySQL queries
docs(readme): update installation instructions for Python 3.12
Releases are managed by project maintainers:
- Update version in
pyproject.toml - Update CHANGELOG.md
- Create a git tag:
git tag -a v1.0.0 -m "Release v1.0.0" - Push tag:
git push origin v1.0.0 - GitHub Actions will automatically publish to PyPI
- Documentation: Check the README and inline documentation
- Issues: Search existing issues or create a new one
- Discussions: Use GitHub Discussions for questions and ideas
Contributors will be recognized in:
- The project README
- Release notes
- Git commit history
Thank you for contributing to the Text2SQL Evaluation Toolkit!