From 72ce33974eb1beca546cec5adb2543d8f4e23dca Mon Sep 17 00:00:00 2001 From: frank-sift Date: Wed, 21 Jan 2026 16:05:45 -0800 Subject: [PATCH 01/11] add live eval arg to RuleCreate class --- python/lib/sift_client/_internal/low_level_wrappers/rules.py | 1 + python/lib/sift_client/sift_types/rule.py | 1 + 2 files changed, 2 insertions(+) diff --git a/python/lib/sift_client/_internal/low_level_wrappers/rules.py b/python/lib/sift_client/_internal/low_level_wrappers/rules.py index d29b7b1b8..b630869c7 100644 --- a/python/lib/sift_client/_internal/low_level_wrappers/rules.py +++ b/python/lib/sift_client/_internal/low_level_wrappers/rules.py @@ -128,6 +128,7 @@ def _update_rule_request_from_create(self, create: RuleCreate) -> UpdateRuleRequ organization_id=create.organization_id or "", client_key=create.client_key, is_external=create.is_external, + is_live_evaluation_enabled=create.is_live_evaluation_enabled, conditions=conditions_request, asset_configuration=RuleAssetConfiguration( asset_ids=create.asset_ids or [], diff --git a/python/lib/sift_client/sift_types/rule.py b/python/lib/sift_client/sift_types/rule.py index 5713f0b7a..88fa86410 100644 --- a/python/lib/sift_client/sift_types/rule.py +++ b/python/lib/sift_client/sift_types/rule.py @@ -166,6 +166,7 @@ class RuleCreateUpdateBase(ModelCreateUpdateBase): asset_tag_ids: list[str] | None = None contextual_channels: list[str] | None = None is_external: bool = False + is_live_evaluation_enabled: bool = False class RuleCreate(RuleCreateUpdateBase, ModelCreate[CreateRuleRequest]): From 6ad992f6a90c6b1bf2ca737cd912a81fcefe233a Mon Sep 17 00:00:00 2001 From: frank-sift Date: Wed, 21 Jan 2026 17:13:49 -0800 Subject: [PATCH 02/11] add addl field to Rule class --- python/lib/sift_client/sift_types/rule.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/lib/sift_client/sift_types/rule.py b/python/lib/sift_client/sift_types/rule.py index 88fa86410..7781cd714 100644 --- a/python/lib/sift_client/sift_types/rule.py +++ b/python/lib/sift_client/sift_types/rule.py @@ -53,6 +53,8 @@ class Rule(BaseType[RuleProto, "Rule"]): organization_id: str is_archived: bool is_external: bool + is_live_evaluation_enabled: bool + current_version_id: str # Optional fields expression: str | None From 7a5be96acdda4c85b97f775fc732350334902edc Mon Sep 17 00:00:00 2001 From: frank-sift Date: Wed, 21 Jan 2026 17:25:41 -0800 Subject: [PATCH 03/11] addl changes --- python/lib/sift_client/sift_types/rule.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/lib/sift_client/sift_types/rule.py b/python/lib/sift_client/sift_types/rule.py index 7781cd714..765b648c6 100644 --- a/python/lib/sift_client/sift_types/rule.py +++ b/python/lib/sift_client/sift_types/rule.py @@ -155,6 +155,8 @@ def _from_proto(cls, proto: RuleProto, sift_client: SiftClient | None = None) -> ), is_archived=proto.is_archived, is_external=proto.is_external, + is_live_evaluation_enabled=proto.is_live_evaluation_enabled, + current_version_id=proto.current_version_id, _client=sift_client, ) From 92ca67a9b75b34b02addacc03883ee5c9c9dc6ae Mon Sep 17 00:00:00 2001 From: frank-sift Date: Wed, 21 Jan 2026 17:26:02 -0800 Subject: [PATCH 04/11] update test --- python/lib/sift_client/_tests/sift_types/test_rule.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/lib/sift_client/_tests/sift_types/test_rule.py b/python/lib/sift_client/_tests/sift_types/test_rule.py index 31dc2fa74..99179feae 100644 --- a/python/lib/sift_client/_tests/sift_types/test_rule.py +++ b/python/lib/sift_client/_tests/sift_types/test_rule.py @@ -46,6 +46,8 @@ def mock_rule(mock_client): client_key=None, rule_version=None, archived_date=None, + is_live_evaluation_enabled=False, + current_version_id="test_version_id", ) rule._apply_client_to_instance(mock_client) return rule From 4f07720b0b2bf81fcd267e3e07a36423bd0e8b1e Mon Sep 17 00:00:00 2001 From: frank-sift Date: Thu, 22 Jan 2026 10:14:13 -0800 Subject: [PATCH 05/11] intial rename --- .../lib/sift_client/_internal/low_level_wrappers/rules.py | 3 +-- python/lib/sift_client/sift_types/rule.py | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/python/lib/sift_client/_internal/low_level_wrappers/rules.py b/python/lib/sift_client/_internal/low_level_wrappers/rules.py index b630869c7..c1d29b458 100644 --- a/python/lib/sift_client/_internal/low_level_wrappers/rules.py +++ b/python/lib/sift_client/_internal/low_level_wrappers/rules.py @@ -124,11 +124,10 @@ def _update_rule_request_from_create(self, create: RuleCreate) -> UpdateRuleRequ update_request = UpdateRuleRequest( name=create.name, description=create.description, - is_enabled=True, organization_id=create.organization_id or "", client_key=create.client_key, is_external=create.is_external, - is_live_evaluation_enabled=create.is_live_evaluation_enabled, + is_live_evaluation_enabled=create.is_live, conditions=conditions_request, asset_configuration=RuleAssetConfiguration( asset_ids=create.asset_ids or [], diff --git a/python/lib/sift_client/sift_types/rule.py b/python/lib/sift_client/sift_types/rule.py index 765b648c6..e1990618e 100644 --- a/python/lib/sift_client/sift_types/rule.py +++ b/python/lib/sift_client/sift_types/rule.py @@ -45,7 +45,6 @@ class Rule(BaseType[RuleProto, "Rule"]): # Required fields name: str description: str - is_enabled: bool created_date: datetime modified_date: datetime created_by_user_id: str @@ -53,7 +52,7 @@ class Rule(BaseType[RuleProto, "Rule"]): organization_id: str is_archived: bool is_external: bool - is_live_evaluation_enabled: bool + is_live: bool current_version_id: str # Optional fields @@ -137,7 +136,6 @@ def _from_proto(cls, proto: RuleProto, sift_client: SiftClient | None = None) -> ].expression.calculated_channel.channel_references.items() ], action=RuleAction._from_proto(proto.conditions[0].actions[0]), - is_enabled=proto.is_enabled, created_date=proto.created_date.ToDatetime(tzinfo=timezone.utc), modified_date=proto.modified_date.ToDatetime(tzinfo=timezone.utc), created_by_user_id=proto.created_by_user_id, @@ -155,7 +153,7 @@ def _from_proto(cls, proto: RuleProto, sift_client: SiftClient | None = None) -> ), is_archived=proto.is_archived, is_external=proto.is_external, - is_live_evaluation_enabled=proto.is_live_evaluation_enabled, + is_live=proto.is_live_evaluation_enabled, current_version_id=proto.current_version_id, _client=sift_client, ) @@ -170,7 +168,7 @@ class RuleCreateUpdateBase(ModelCreateUpdateBase): asset_tag_ids: list[str] | None = None contextual_channels: list[str] | None = None is_external: bool = False - is_live_evaluation_enabled: bool = False + is_live: bool = False class RuleCreate(RuleCreateUpdateBase, ModelCreate[CreateRuleRequest]): From 66eef9f3b38d4eca9c9a2cb6ad31b7f9bccc680b Mon Sep 17 00:00:00 2001 From: frank-sift Date: Thu, 22 Jan 2026 10:57:33 -0800 Subject: [PATCH 06/11] make update non trivial --- python/lib/sift_client/_internal/low_level_wrappers/rules.py | 5 +++++ python/lib/sift_client/_tests/resources/test_rules.py | 1 - python/lib/sift_client/_tests/sift_types/test_rule.py | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python/lib/sift_client/_internal/low_level_wrappers/rules.py b/python/lib/sift_client/_internal/low_level_wrappers/rules.py index c1d29b458..23f2ee448 100644 --- a/python/lib/sift_client/_internal/low_level_wrappers/rules.py +++ b/python/lib/sift_client/_internal/low_level_wrappers/rules.py @@ -207,6 +207,7 @@ def _update_rule_request_from_update( "contextual_channels", "asset_ids", "asset_tag_ids", + "is_live", ] # Need to manually copy fields that will be reset even if not provided in update dict. copy_unset_fields = ["description", "name"] @@ -262,6 +263,10 @@ def _update_rule_request_from_update( channels=[ChannelReferenceProto(name=c) for c in update.contextual_channels or []] ) + # Map is_live (class field) to is_live_evaluation_enabled (proto field) + if "is_live" in model_dump: + update_dict["is_live_evaluation_enabled"] = update.is_live + # This always needs to be set, so handle the defaults. update_dict["asset_configuration"] = RuleAssetConfiguration( # type: ignore asset_ids=(update.asset_ids if "asset_ids" in model_dump else rule.asset_ids or []), diff --git a/python/lib/sift_client/_tests/resources/test_rules.py b/python/lib/sift_client/_tests/resources/test_rules.py index d870e3a2a..c0fc581ea 100644 --- a/python/lib/sift_client/_tests/resources/test_rules.py +++ b/python/lib/sift_client/_tests/resources/test_rules.py @@ -335,7 +335,6 @@ async def test_update_rule_description(self, rules_api_async, new_rule): assert updated_rule.description == "Updated description" # Validate that things we didn't intentionally change didn't change assert updated_rule.name == new_rule.name - assert updated_rule.is_enabled == new_rule.is_enabled assert updated_rule.is_external == new_rule.is_external assert updated_rule.expression == new_rule.expression assert updated_rule.action.action_type == new_rule.action.action_type diff --git a/python/lib/sift_client/_tests/sift_types/test_rule.py b/python/lib/sift_client/_tests/sift_types/test_rule.py index 99179feae..de96e380e 100644 --- a/python/lib/sift_client/_tests/sift_types/test_rule.py +++ b/python/lib/sift_client/_tests/sift_types/test_rule.py @@ -23,7 +23,6 @@ def mock_rule(mock_client): id_="test_rule_id", name="test_rule", description="test description", - is_enabled=True, created_date=datetime.now(timezone.utc), modified_date=datetime.now(timezone.utc), created_by_user_id="user1", @@ -46,7 +45,7 @@ def mock_rule(mock_client): client_key=None, rule_version=None, archived_date=None, - is_live_evaluation_enabled=False, + is_live=False, current_version_id="test_version_id", ) rule._apply_client_to_instance(mock_client) From 2cf20a8a12cd2a3d456a176866d0c9d5ed2d21d5 Mon Sep 17 00:00:00 2001 From: frank-sift Date: Thu, 22 Jan 2026 11:03:38 -0800 Subject: [PATCH 07/11] always remap --- python/lib/sift_client/_internal/low_level_wrappers/rules.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/lib/sift_client/_internal/low_level_wrappers/rules.py b/python/lib/sift_client/_internal/low_level_wrappers/rules.py index 23f2ee448..4580290fd 100644 --- a/python/lib/sift_client/_internal/low_level_wrappers/rules.py +++ b/python/lib/sift_client/_internal/low_level_wrappers/rules.py @@ -264,8 +264,7 @@ def _update_rule_request_from_update( ) # Map is_live (class field) to is_live_evaluation_enabled (proto field) - if "is_live" in model_dump: - update_dict["is_live_evaluation_enabled"] = update.is_live + update_dict["is_live_evaluation_enabled"] = update.is_live # This always needs to be set, so handle the defaults. update_dict["asset_configuration"] = RuleAssetConfiguration( # type: ignore From d916f6446a7d49b27c92d4f695fe9342017adc76 Mon Sep 17 00:00:00 2001 From: frank-sift Date: Thu, 22 Jan 2026 11:14:18 -0800 Subject: [PATCH 08/11] fix update types --- python/lib/sift_client/_internal/low_level_wrappers/rules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lib/sift_client/_internal/low_level_wrappers/rules.py b/python/lib/sift_client/_internal/low_level_wrappers/rules.py index 4580290fd..7deab003f 100644 --- a/python/lib/sift_client/_internal/low_level_wrappers/rules.py +++ b/python/lib/sift_client/_internal/low_level_wrappers/rules.py @@ -264,7 +264,7 @@ def _update_rule_request_from_update( ) # Map is_live (class field) to is_live_evaluation_enabled (proto field) - update_dict["is_live_evaluation_enabled"] = update.is_live + update_dict["is_live_evaluation_enabled"] = model_dump.get("is_live", rule.is_live) # This always needs to be set, so handle the defaults. update_dict["asset_configuration"] = RuleAssetConfiguration( # type: ignore From 6a1101b5808dd139ed390c7e4073986daa031c0b Mon Sep 17 00:00:00 2001 From: frank-sift Date: Mon, 26 Jan 2026 10:24:46 -0800 Subject: [PATCH 09/11] make field more descriptive --- .../lib/sift_client/_internal/low_level_wrappers/rules.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/lib/sift_client/_internal/low_level_wrappers/rules.py b/python/lib/sift_client/_internal/low_level_wrappers/rules.py index 7deab003f..d93959141 100644 --- a/python/lib/sift_client/_internal/low_level_wrappers/rules.py +++ b/python/lib/sift_client/_internal/low_level_wrappers/rules.py @@ -127,7 +127,7 @@ def _update_rule_request_from_create(self, create: RuleCreate) -> UpdateRuleRequ organization_id=create.organization_id or "", client_key=create.client_key, is_external=create.is_external, - is_live_evaluation_enabled=create.is_live, + is_live_evaluation_enabled=create.evaluate_on_live_data, conditions=conditions_request, asset_configuration=RuleAssetConfiguration( asset_ids=create.asset_ids or [], @@ -207,7 +207,7 @@ def _update_rule_request_from_update( "contextual_channels", "asset_ids", "asset_tag_ids", - "is_live", + "evaluate_on_live_data", ] # Need to manually copy fields that will be reset even if not provided in update dict. copy_unset_fields = ["description", "name"] @@ -264,7 +264,9 @@ def _update_rule_request_from_update( ) # Map is_live (class field) to is_live_evaluation_enabled (proto field) - update_dict["is_live_evaluation_enabled"] = model_dump.get("is_live", rule.is_live) + update_dict["is_live_evaluation_enabled"] = model_dump.get( + "evaluate_on_live_data", rule.evaluate_on_live_data + ) # This always needs to be set, so handle the defaults. update_dict["asset_configuration"] = RuleAssetConfiguration( # type: ignore From 5fee260eaaea1889e143e0006fea1d2bff382d65 Mon Sep 17 00:00:00 2001 From: frank-sift Date: Mon, 26 Jan 2026 10:27:13 -0800 Subject: [PATCH 10/11] update rule --- python/lib/sift_client/sift_types/rule.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/lib/sift_client/sift_types/rule.py b/python/lib/sift_client/sift_types/rule.py index e1990618e..0b241625a 100644 --- a/python/lib/sift_client/sift_types/rule.py +++ b/python/lib/sift_client/sift_types/rule.py @@ -52,7 +52,7 @@ class Rule(BaseType[RuleProto, "Rule"]): organization_id: str is_archived: bool is_external: bool - is_live: bool + evaluate_on_live_data: bool current_version_id: str # Optional fields @@ -153,7 +153,7 @@ def _from_proto(cls, proto: RuleProto, sift_client: SiftClient | None = None) -> ), is_archived=proto.is_archived, is_external=proto.is_external, - is_live=proto.is_live_evaluation_enabled, + evaluate_on_live_data=proto.is_live_evaluation_enabled, current_version_id=proto.current_version_id, _client=sift_client, ) @@ -168,7 +168,7 @@ class RuleCreateUpdateBase(ModelCreateUpdateBase): asset_tag_ids: list[str] | None = None contextual_channels: list[str] | None = None is_external: bool = False - is_live: bool = False + evaluate_on_live_data: bool = False class RuleCreate(RuleCreateUpdateBase, ModelCreate[CreateRuleRequest]): From c2562b0acf326f1686c9b652230e09216578cdc7 Mon Sep 17 00:00:00 2001 From: frank-sift Date: Mon, 26 Jan 2026 10:27:34 -0800 Subject: [PATCH 11/11] update test --- python/lib/sift_client/_tests/sift_types/test_rule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lib/sift_client/_tests/sift_types/test_rule.py b/python/lib/sift_client/_tests/sift_types/test_rule.py index de96e380e..05a15381f 100644 --- a/python/lib/sift_client/_tests/sift_types/test_rule.py +++ b/python/lib/sift_client/_tests/sift_types/test_rule.py @@ -45,7 +45,7 @@ def mock_rule(mock_client): client_key=None, rule_version=None, archived_date=None, - is_live=False, + evaluate_on_live_data=False, current_version_id="test_version_id", ) rule._apply_client_to_instance(mock_client)