Skip to content

Commit c3f6d29

Browse files
authored
Add more clarification around options and around validation rules and constraints (#38)
1 parent feb8691 commit c3f6d29

File tree

1 file changed

+68
-1
lines changed

1 file changed

+68
-1
lines changed

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,77 @@ Options:
5353
- `--schema` Schema type: eppo (default) or dbt-model
5454
- `--sync-prefix` Prefix for fact/metric names (useful for testing)
5555
- `--dbt-model-prefix` Warehouse/schema prefix for dbt models
56+
- `--allow-upgrades` Allow existing non-certified metrics/fact sources to become certified
57+
58+
#### When to use `--allow-upgrades`
59+
60+
The `--allow-upgrades` flag is useful in the following scenarios:
61+
62+
- **Promoting existing metrics to certified status**: If you have existing metrics or fact sources in Eppo that are not currently certified, this flag allows them to be upgraded to certified status during the sync process.
63+
- **Migrating from manual to code-managed metrics**: When transitioning from manually created metrics in the Eppo UI to managing them through YAML files, this flag enables the promotion of those metrics to certified status.
64+
- **Avoiding conflicts during migration**: Without this flag, attempting to sync metrics that already exist in a non-certified state may result in conflicts or the sync process not upgrading their certification status.
65+
66+
## Validation Rules & Constraints
67+
68+
The following validation rules are enforced when syncing metrics. Understanding these constraints upfront can help avoid validation errors during development:
69+
70+
### Winsorization Constraints
71+
72+
Winsorization parameters (`winsorization_lower_percentile`, `winsorization_upper_percentile`) can **only** be used with these aggregation operations:
73+
-`sum`
74+
-`count`
75+
-`last_value`
76+
-`first_value`
77+
78+
**Not supported for:**
79+
-`count_distinct` - Use different outlier handling approaches
80+
-`distinct_entity` - Binary metrics don't need winsorization
81+
-`threshold` - Threshold logic handles outliers differently
82+
-`retention` - Binary retention metrics don't need winsorization
83+
-`conversion` - Binary conversion metrics don't need winsorization
84+
85+
### Advanced Aggregation Parameters
86+
87+
Each advanced aggregation type requires its specific parameter and cannot use others:
88+
89+
#### Threshold Metrics
90+
- **Required**: `threshold_metric_settings` object with:
91+
- `comparison_operator`: "gt" or "gte"
92+
- `aggregation_type`: "sum" or "count" (**not** count_distinct)
93+
- `breach_value`: numeric threshold value
94+
- **Cannot use**: `retention_threshold_days`, `conversion_threshold_days`
95+
96+
#### Retention Metrics
97+
- **Required**: `retention_threshold_days` (numeric)
98+
- **Cannot use**: `threshold_metric_settings`, `conversion_threshold_days`
99+
100+
#### Conversion Metrics
101+
- **Required**: `conversion_threshold_days` (numeric)
102+
- **Cannot use**: `threshold_metric_settings`, `retention_threshold_days`
103+
- **Cannot use**: Timeframe parameters (`aggregation_timeframe_start_value`, `aggregation_timeframe_end_value`)
104+
105+
### Timeframe Parameters
106+
107+
When using aggregation timeframe parameters:
108+
- **Required**: `aggregation_timeframe_unit` must be specified if any timeframe parameters are used
109+
- **Supported units**: "minutes", "hours", "days", "weeks", "calendar_days"
110+
- **Not supported for**: `conversion` operations (use `conversion_threshold_days` instead)
111+
112+
### Denominator Constraints
113+
114+
For ratio metrics, denominators can only use these operations:
115+
-`sum`, `count`, `count_distinct`, `distinct_entity`, `last_value`, `first_value`
116+
- ❌ Cannot use: `threshold`, `retention`, `conversion`
117+
118+
### Guardrail Cutoff Signs
119+
120+
When using guardrail metrics (`is_guardrail: true` with `guardrail_cutoff`):
121+
- If fact's `desired_change: "increase"``guardrail_cutoff` must be **negative**
122+
- If fact's `desired_change: "decrease"``guardrail_cutoff` must be **positive**
56123

57124
## Documentation
58125

59-
For detailed information about metric configuration and available options, see Eppo's [documentation page](https://docs.geteppo.com/data-management/certified-metrics/).
126+
For detailed information about metric configuration, available options and constraints, see Eppo's [documentation page](https://docs.geteppo.com/data-management/certified-metrics/).
60127

61128
### Example YAML Configuration
62129

0 commit comments

Comments
 (0)