Skip to content

Eppo importer: each-record facts import as counts - #7419

Open
gazzdingo wants to merge 1 commit into
mainfrom
guy/eppo-each-record-facts
Open

gazzdingo wants to merge 1 commit into
mainfrom
guy/eppo-each-record-facts

Conversation

@gazzdingo

Copy link
Copy Markdown
Collaborator

Features and Changes

Fixes Column "1" isn't in the X Fact Table on import.

Eppo's "Each Record" facts have no value column; the API sends the constant 1 instead, and the importer treated that as a column name. A sum of an each-record fact now imports as a count ($$count), the same for a threshold metric's sum. Aggregations that need a real column (count distinct, percentile) say the fact counts each record instead of a misleading missing-column error, and any other constant is called out as a constant.

Dependencies

None.

Testing

  • pnpm --filter front-end test test/services/eppo-importing.test.ts (50 tests, with the each-record cases added)

Screenshots

None.

Eppo's API sends the constant 1 as the value column of an "Each Record"
fact, which the importer looked up as a column and rejected with
'Column "1" isn't in the Fact Table'. Summing it now counts records;
aggregations that need a real column say the fact counts each record.
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects the Eppo metric-import workflow.

The PR appears safe to merge, with a non-blocking request to test the each-record threshold branch.

Reviews (1) · Last reviewed commit: "Eppo importer: treat an each-record fact..." · Reviewed by Greptile

Comment on lines +923 to +925
t.aggregation_type === "sum" && !isEachRecord(agg.column)
? valueColumn()
: "$$count",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Threshold fix lacks a test

The new each-record threshold branch has no regression test. Existing threshold tests sum "revenue" or explicitly request a count, so they would still pass if this fix were removed. Add a case with aggregation_type: "sum" and column: "1" that checks aggregateFilterColumn: "$$count" and preserves the comparison.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/front-end/services/importing/eppo/eppo-importing.ts
Line: 923-925

Comment:
**Threshold fix lacks a test**

The new each-record threshold branch has no regression test. Existing threshold tests sum `"revenue"` or explicitly request a count, so they would still pass if this fix were removed. Add a case with `aggregation_type: "sum"` and `column: "1"` that checks `aggregateFilterColumn: "$$count"` and preserves the comparison.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

This branch had an error being deployed

1 failed deployment
preview — 5c1d9c44 Deployed Oct 22, 2026 by gazzdingo via preview #30492
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