From 629be8eb70101cb134a8ec9a98943c8c1f863206 Mon Sep 17 00:00:00 2001 From: Tyler Buffington Date: Tue, 19 Nov 2024 17:29:51 -0600 Subject: [PATCH 1/4] Added support for guardrail cutoffs --- eppo_metrics_sync/schema/eppo_metric_schema.json | 4 ++++ tests/yaml/valid/purchases.yaml | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/eppo_metrics_sync/schema/eppo_metric_schema.json b/eppo_metrics_sync/schema/eppo_metric_schema.json index 1041cad..6a37a84 100644 --- a/eppo_metrics_sync/schema/eppo_metric_schema.json +++ b/eppo_metrics_sync/schema/eppo_metric_schema.json @@ -307,6 +307,10 @@ "type": "number" } } + }, + "guardrail_cutoff": { + "description": "The guardrail cutoff for the metric", + "type": "number" } } } diff --git a/tests/yaml/valid/purchases.yaml b/tests/yaml/valid/purchases.yaml index 78ce9ff..76ae8e9 100644 --- a/tests/yaml/valid/purchases.yaml +++ b/tests/yaml/valid/purchases.yaml @@ -28,6 +28,13 @@ metrics: numerator: fact_name: Purchase operation: distinct_entity +- name: Guardrail metric + entity: User # it would be nice if this was optional if there is exactly 1 entity defined above + is_guardrail: true + guardrail_cutoff: 0.03 + numerator: + fact_name: Purchase + operation: distinct_entity - name: AOV entity: User numerator: From a3f617875603ca8eed07c4ac8fde070984efa395 Mon Sep 17 00:00:00 2001 From: Tyler Buffington Date: Tue, 19 Nov 2024 17:30:47 -0600 Subject: [PATCH 2/4] version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5158d36..fad5583 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='eppo_metrics_sync', - version='0.1.0', + version='0.1.1', packages=find_packages(), install_requires=[ 'PyYAML', 'jsonschema', 'requests' From 6d91d0f2eab85a1d9d553da80901309ce17c78ce Mon Sep 17 00:00:00 2001 From: Tyler Buffington Date: Tue, 19 Nov 2024 17:31:56 -0600 Subject: [PATCH 3/4] cleaned up test file --- tests/yaml/valid/purchases.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/yaml/valid/purchases.yaml b/tests/yaml/valid/purchases.yaml index 76ae8e9..57ae6b3 100644 --- a/tests/yaml/valid/purchases.yaml +++ b/tests/yaml/valid/purchases.yaml @@ -29,7 +29,7 @@ metrics: fact_name: Purchase operation: distinct_entity - name: Guardrail metric - entity: User # it would be nice if this was optional if there is exactly 1 entity defined above + entity: User is_guardrail: true guardrail_cutoff: 0.03 numerator: From 9df4f88b4bcaa183605980a3e176335753f88499 Mon Sep 17 00:00:00 2001 From: Tyler Buffington Date: Wed, 20 Nov 2024 15:47:32 -0600 Subject: [PATCH 4/4] Reverted schema and version bump since change had already been made --- eppo_metrics_sync/schema/eppo_metric_schema.json | 4 ---- setup.py | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/eppo_metrics_sync/schema/eppo_metric_schema.json b/eppo_metrics_sync/schema/eppo_metric_schema.json index 6a37a84..1041cad 100644 --- a/eppo_metrics_sync/schema/eppo_metric_schema.json +++ b/eppo_metrics_sync/schema/eppo_metric_schema.json @@ -307,10 +307,6 @@ "type": "number" } } - }, - "guardrail_cutoff": { - "description": "The guardrail cutoff for the metric", - "type": "number" } } } diff --git a/setup.py b/setup.py index fad5583..5158d36 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='eppo_metrics_sync', - version='0.1.1', + version='0.1.0', packages=find_packages(), install_requires=[ 'PyYAML', 'jsonschema', 'requests'