Skip to content

Commit d881d7c

Browse files
committed
Add new scenario and update formatting
1 parent cf932c2 commit d881d7c

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

tests/test_validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_valid_guardrail_cutoff_signs():
5454
eppo_metrics_sync = EppoMetricsSync(directory = None)
5555
eppo_metrics_sync.load_yaml(
5656
path = test_yaml_dir + "/duplicated_fact_property_names.yaml")
57-
57+
5858
with pytest.raises(ValueError, match = "Fact property names are not unique: device"):
5959
eppo_metrics_sync.validate()"""
6060

@@ -151,4 +151,4 @@ def test_first_value():
151151
def test_valid_yaml():
152152
eppo_metrics_sync = EppoMetricsSync(directory=None)
153153
eppo_metrics_sync.load_eppo_yaml(path='tests/yaml/valid/purchases.yaml')
154-
eppo_metrics_sync.validate()
154+
eppo_metrics_sync.validate()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
fact_sources:
2+
- name: upgrades_table
3+
sql: select * from upgrades
4+
timestamp_column: ts
5+
entities:
6+
- entity_name: user
7+
column: user_id
8+
facts:
9+
- name: upgrades
10+
metrics:
11+
- name: Total Upgrades to Paid Plan
12+
entity: User
13+
type: Nonexistent
14+
numerator:
15+
fact_name: upgrades
16+
operation: sum

tests/yaml/valid/purchases.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
fact_sources:
22
- name: Purchase
33
sql: |
4-
SELECT
4+
SELECT
55
events.*
66
FROM customer_db.onboarding.events as events
77
WHERE event_type = 'Revenue'
@@ -30,6 +30,7 @@ metrics:
3030
operation: distinct_entity
3131
- name: AOV
3232
entity: User
33+
type: ratio
3334
numerator:
3435
fact_name: Purchase
3536
operation: sum

0 commit comments

Comments
 (0)