flagsmith-sql-flag-engine 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/PKG-INFO +1 -1
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/pyproject.toml +1 -1
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/src/flagsmith_sql_flag_engine/translator.py +12 -8
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/README.md +0 -0
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/src/flagsmith_sql_flag_engine/__init__.py +0 -0
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/src/flagsmith_sql_flag_engine/dialect.py +0 -0
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/src/flagsmith_sql_flag_engine/dialects/__init__.py +0 -0
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/src/flagsmith_sql_flag_engine/dialects/clickhouse.py +0 -0
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/src/flagsmith_sql_flag_engine/py.typed +0 -0
- {flagsmith_sql_flag_engine-0.1.2 → flagsmith_sql_flag_engine-0.1.3}/src/flagsmith_sql_flag_engine/utils.py +0 -0
|
@@ -432,7 +432,6 @@ def translate_condition(cond: SegmentCondition, ctx: TranslateContext) -> str |
|
|
|
432
432
|
# Engine: float() on the threshold raises → returns False.
|
|
433
433
|
return "FALSE"
|
|
434
434
|
threshold = float(threshold_lit)
|
|
435
|
-
identity: dict[str, object] = ctx.evaluation_context.get("identity") or {} # type: ignore[assignment]
|
|
436
435
|
kind = classification.kind
|
|
437
436
|
if not prop:
|
|
438
437
|
# In traditional engine implementations, this branch implies
|
|
@@ -457,13 +456,18 @@ def translate_condition(cond: SegmentCondition, ctx: TranslateContext) -> str |
|
|
|
457
456
|
# future work and let the caller fall back to the engine.
|
|
458
457
|
return None
|
|
459
458
|
else:
|
|
460
|
-
# Plain trait key, or `$.identity.traits.<X>` rewritten to
|
|
461
|
-
#
|
|
462
|
-
#
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
459
|
+
# Plain trait key, or `$.identity.traits.<X>` rewritten to the
|
|
460
|
+
# bare key. Hash the per-row trait value from `i.traits:"<key>"`.
|
|
461
|
+
# A row missing the trait has no value to bucket, so it cannot
|
|
462
|
+
# match — mirroring the engine's `context_value is None -> False`.
|
|
463
|
+
trait_sql = ctx.trait_path(prop)
|
|
464
|
+
split = _percentage_split_expr(
|
|
465
|
+
ctx,
|
|
466
|
+
ctx.segment_key,
|
|
467
|
+
ctx.dialect.cast_string(trait_sql),
|
|
468
|
+
threshold,
|
|
469
|
+
)
|
|
470
|
+
return f"({trait_sql} IS NOT NULL AND {split})"
|
|
467
471
|
return _percentage_split_expr(ctx, ctx.segment_key, value_expr, threshold)
|
|
468
472
|
|
|
469
473
|
if not prop:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|