Skip to content

Commit 54d0d68

Browse files
committed
Remove Python evaluation mode
The library now operates exclusively in strict CEL mode - **Removed**: `EvaluationMode.PYTHON` and all automatic integer-to-float promotion - **Removed**: `mode` parameter from `evaluate()` function - **Removed**: `--mode` CLI option - **Behavior change**: Mixed arithmetic like `1 + 2.5` now raises `TypeError` instead of automatically promoting to `3.5` - **Migration**: Use explicit type conversion (e.g., `double(1) + 2.5`) for mixed arithmetic - **Rationale**: Eliminates complex AST preprocessing that was breaking `has()` short-circuiting and other CEL functions ### 🐛 Fixed - **CEL function short-circuiting**: Fixed issue where `has()` and other CEL functions failed due to AST preprocessing interference - **String literal corruption**: Eliminated string literal modification that occurred during integer promotion preprocessing ### Updated - Updated cel crate from v0.11.0 to v0.11.1 - Updated documentation to reflect strict CEL mode operation - Updated tests to work with strict CEL mode only - Removed complex preprocessing logic
1 parent 92919de commit 54d0d68

28 files changed

+1809
-1301
lines changed

CHANGELOG.md

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,40 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
11+
## [0.5.2] - 2025-09-12
12+
13+
### 🚨 Breaking Changes
14+
15+
- **Python evaluation mode removed**: The library now operates exclusively in strict CEL mode
16+
- **Removed**: `EvaluationMode.PYTHON` and all automatic integer-to-float promotion
17+
- **Removed**: `mode` parameter from `evaluate()` function
18+
- **Removed**: `--mode` CLI option
19+
- **Behavior change**: Mixed arithmetic like `1 + 2.5` now raises `TypeError` instead of automatically promoting to `3.5`
20+
- **Migration**: Use explicit type conversion (e.g., `double(1) + 2.5`) for mixed arithmetic
21+
- **Rationale**: Eliminates complex AST preprocessing that was breaking `has()` short-circuiting and other CEL functions
22+
23+
### 🐛 Fixed
24+
25+
- **CEL function short-circuiting**: Fixed issue where `has()` and other CEL functions failed due to AST preprocessing interference
26+
- **String literal corruption**: Eliminated string literal modification that occurred during integer promotion preprocessing
27+
28+
### Updated
29+
30+
- Updated cel crate from v0.11.0 to v0.11.1
31+
- Updated documentation to reflect strict CEL mode operation
32+
- Updated tests to work with strict CEL mode only
33+
- Removed complex preprocessing logic
34+
835
## [0.5.1] - 2025-08-11
936

1037
### ✨ Added
1138

12-
- **EvaluationMode enum**: Control type handling behavior in CEL expressions
13-
- `EvaluationMode.PYTHON` (default for Python API): Python-friendly type promotions
14-
- `EvaluationMode.STRICT` (default for CLI): Strict CEL type rules with no coercion
39+
- **EvaluationMode enum**: Control type handling behavior in CEL expressions *(deprecated and removed in later version)*
40+
- `EvaluationMode.PYTHON` (default for Python API): Python-friendly type promotions *(removed)*
41+
- `EvaluationMode.STRICT` (default for CLI): Strict CEL type rules with no coercion *(now the only mode)*
1542
- **Type checking support**: Added complete type stub files (`.pyi`) for PyO3 extension
1643

1744

@@ -39,7 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3966
## [0.4.1] - 2025-08-02
4067

4168
### ✨ Added
42-
- **Automatic type coercion** for mixed int/float arithmetic:
69+
- **Automatic type coercion** for mixed int/float arithmetic *(deprecated and removed in later version)*:
4370
- Float literals automatically promote integer literals to floats.
4471
- Context variables containing floats trigger int → float promotion.
4572
- Preserves array indexing with integers (e.g., `list[2]` stays integer).

0 commit comments

Comments
 (0)