Skip to content

Conversation

@winsmith
Copy link
Contributor

Retention queries were a special case before, but this PR treats them like funnel or experiment queries.

winsmith and others added 3 commits August 22, 2025 13:25
- Add retention case to CustomQuery.QueryType enum
- Create CustomQuery+Retention.swift with precompiledRetentionQuery() method
- Integrate retention query compilation into precompile() flow
- Change CustomQuery.granularity from let to var to allow mutation
- Update tests to verify both new and legacy approaches work

This brings retention queries in line with funnel and experiment queries,
using the same compile-down pattern for consistency.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Delete RetentionQueryGenerator.swift as functionality moved to CustomQuery+Retention
- Update tests to use new compile-down approach exclusively
- Remove references to legacy generateRetentionQuery method

The retention query generation now fully uses the compile-down pattern,
consistent with funnel and experiment queries.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Retention period now determined by query's granularity property
- Support day, week, month, quarter, and year retention periods
- Add validation for minimum intervals based on granularity
- Implement generic interval splitting for all supported granularities
- Add comprehensive tests for different retention granularities

The retention query now respects the granularity setting instead of
always using monthly retention, providing more flexibility for different
retention analysis periods.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@winsmith winsmith merged commit 5eb2c37 into main Aug 22, 2025
3 checks passed
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.

2 participants