v0.11.2 - Type Safety & Code Quality Improvements (2025-12-28)¶
What Changed?¶
This patch release enhances code quality and type safety across the example scripts.
The --compression option in from_jsonl_to_parquet.py now uses Literal type hints for better IDE support and type checking.
All changes maintain full backward compatibility with existing workflows.
What's New¶
Type-Safe Compression Option¶
What it does:
The --compression parameter in from_jsonl_to_parquet.py now uses Python's Literal type hint to restrict values to valid compression codecs: snappy, gzip, zstd, or none.
Benefits:
- IDE Autocomplete: Modern IDEs can now offer autocomplete suggestions for compression options
- Type Checking: Static type checkers (mypy, pyright) can validate compression values before runtime
- Better Error Messages: Invalid values are caught during development, not at runtime
- Self-Documenting Code: The valid options are explicit in the type signature
Example:
# Type hint now shows allowed values
compression: Literal["snappy", "gzip", "zstd", "none"] = typer.Option(
"snappy", "--compression", help="Compression codec"
)
Installation¶
Quick Start¶
# Get the release
git checkout v0.11.2
# Setup
task env:setup
# Try the type-safe compression option
uv run examples/from_jsonl_to_parquet.py ./path/to/events/ output.parquet --compression snappy
# Or run the CLI as usual
uv run kazunoko --help
What's Different from the Last Version?¶
✅ Added¶
- Type-safe compression parameter in
from_jsonl_to_parquet.pyusing Python'sLiteraltype hint - IDE autocomplete support for
--compressionoption values (snappy, gzip, zstd, none) - Static type checking validation for compression codec selection
🔧 Changed¶
compressionparameter now usesLiteral["snappy", "gzip", "zstd", "none"]type annotation for better code quality- Parameter validation is now enforced by type checkers at development time instead of runtime
🐛 Fixed¶
- No bug fixes in this release (patch release focused on code quality improvements)
Is It Safe to Upgrade?¶
Backward Compatible: Yes
- All changes are purely technical (type annotations) with no behavioral changes
- Existing
from_jsonl_to_parquet.pyinvocations work unchanged - The
--compressionoption accepts the same values (snappy, gzip, zstd, none) - Type hints improve development experience without affecting runtime behavior
- No impact on users who don't use static type checking
- All other example scripts remain unchanged
Tests Passed¶
- ✅ Builds without errors
- ✅ Type checking passes with mypy/pyright for compression parameter
- ✅
from_jsonl_to_parquet.pyworks with all compression codec values - ✅ IDE autocomplete working correctly for
--compressionvalues - ✅ Backward compatibility verified with existing scripts and workflows
Release Details¶
- Date: 2025-12-28
- Version: v0.11.2
- Files Changed: 2 (from_jsonl_to_parquet.py, docs/releases/v0.11.2.md)
- Commits: 9fbfdbe, 54be6e0
Commit Summary:
9fbfdbe- Bump version 0.11.1 → 0.11.254be6e0- Refactor examples: use Literal type for compression option
Next Steps¶
Future enhancements planned:
- Broader Type Safety: Apply Literal type hints to other optional parameters across example scripts
- Runtime Validation: Add runtime type validation for users not using static type checkers
- Data Format Export: Support for additional export formats (HDF5, NetCDF) for advanced data analysis
- Batch Processing: Multi-run conversion capabilities for processing multiple measurement directories in one command