Skip to content

feat: add optional creator_email, updater_email, team_name to Metric Sync API payload#16

Open
bertilhatt wants to merge 1 commit intomainfrom
feature/metric-sync-creator-updater-team
Open

feat: add optional creator_email, updater_email, team_name to Metric Sync API payload#16
bertilhatt wants to merge 1 commit intomainfrom
feature/metric-sync-creator-updater-team

Conversation

@bertilhatt
Copy link

Summary

Adds support for the new optional Metric Sync API fields: creator_email, updater_email, and team_name at both sync-level and per-metric level. Sync-level values apply as defaults to all metrics; individual metrics can override via dbt meta keys.

Resolves: FFESUPPORT-407

Dependency: This work depends on the Metric Sync API changes in Eppo-exp/eppoPR #13697. That PR augments the API to accept these optional body fields and defines semantics (omit = clear, lookup failure = clear, per-metric overrides). This PR updates dbt-eppo-sync to send the new fields when configured.


Changes

1. Mapper (mapper.py)

  • Sync-level: map_dbt_to_eppo_sync_payload() now accepts optional creator_email, updater_email, and team_name. When provided, they are included in the top-level request body next to sync_tag, fact_sources, and metrics. When omitted, the keys are not sent (API treats omit as clear).
  • Per-metric: For each metric, the mapper reads from meta:
    • eppo_creator_emailcreator_email
    • eppo_updater_emailupdater_email
    • eppo_team_nameteam_name
      Only metrics that define these in meta get the corresponding keys on their object; others rely on sync-level defaults on the API side.

2. Sync orchestration (sync.py)

  • run_sync() accepts optional creator_email, updater_email, and team_name and passes them through to the mapper.

3. CLI (cli.py)

  • New options: --creator-email, --updater-email, --team-name.
  • Config file: Optional sync config is read from dbt_project.yml:
    • Top-level key eppo_sync, or
    • vars.eppo_sync
      Supported keys: creator_email, updater_email, team_name. CLI options override config file values when both are set.

4. Schema (eppo_metric_schema.json)

  • Top-level optional properties: creator_email, updater_email, team_name (with descriptions and format/length constraints).
  • Under metrics.items: same three as optional per-metric properties.

5. Tests

  • test_mapper.py: test_map_sync_level_creator_updater_team, test_map_sync_level_omit_optional_metadata, test_map_per_metric_override_creator_team.
  • test_sync.py: test_run_sync_passes_creator_updater_team_to_mapper, and assertions in test_run_sync_successful_live that mapper is called with the new params (as None when not provided).

Usage

CLI (overrides config):

dbt-eppo-sync --dbt-project-dir . --manifest-path target/manifest.json \
  --creator-email "data-team@company.com" \
  --updater-email "ci-bot@company.com" \
  --team-name "Analytics"

Config in dbt_project.yml:

eppo_sync:
  creator_email: "data-team@company.com"
  updater_email: "ci-bot@company.com"
  team_name: "Analytics"

Per-metric override in dbt metric YAML:

metrics:
  - name: my_metric
    label: My Metric
    type: sum
    measure: { name: revenue }
    meta:
      eppo_creator_email: "analyst@company.com"
      eppo_team_name: "Growth"

Checklist

  • Sync-level and per-metric fields implemented and only sent when set.
  • CLI options and dbt_project.yml config support.
  • Schema updated; validation continues to pass.
  • Tests added/updated for mapper and run_sync.

…Sync API payload

- Sync-level: optional creator_email, updater_email, team_name in request body
- Per-metric: override via meta (eppo_creator_email, eppo_updater_email, eppo_team_name)
- CLI: --creator-email, --updater-email, --team-name; config from dbt_project.yml (eppo_sync)
- Schema: document new optional fields at sync and metric level
- Tests: mapper and run_sync coverage for new fields

Resolves: FFESUPPORT-407
Depends on: Eppo-exp/eppo#13697 (Metric Sync API augmentation)

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant