statsig-ffi, statsig-pyo3: fix missing exposure_dedupe_max_keys in initializers#7
Merged
Conversation
… initializers The bounded-LRU change added a new field `exposure_dedupe_max_keys` to StatsigOptions but two sibling crates have exhaustive struct literals that don't use `..StatsigOptions::default()`: statsig-ffi/src/statsig_options_c.rs:139 statsig-pyo3/src/statsig_options_py.rs:334 Both now fail to compile with E0063 "missing field". This PR adds the field (defaulted to None) to both initializers so cdylib and Python bindings builds compile again. The C/Python bindings don't surface the new option to callers — that would require adding fields to StatsigOptionsData (C) and StatsigOptionsPy (Python) and threading them through. Defaulting to None preserves the existing behavior (uses SAMPLING_MAX_KEYS) for non-Rust callers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
jmcfarland-figma
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The bounded-LRU change in PR #4 added a new field
exposure_dedupe_max_keys: Option<usize>toStatsigOptions. Two sibling crates have exhaustive struct literals (no..StatsigOptions::default()) and now fail to compile withE0063"missing field":statsig-ffi/src/statsig_options_c.rs:139statsig-pyo3/src/statsig_options_py.rs:334Both initializers now include
exposure_dedupe_max_keys: None. Non-Rust callers (C and Python) retain the existing behavior of using theSAMPLING_MAX_KEYSdefault; surfacing the new option to those bindings would require additional plumbing throughStatsigOptionsDataandStatsigOptionsPywhich is out of scope here.Why
cross build --release -p statsig_ffi(the release workflow's build step) fails because of the missing field. The actual error from a failed run onmainafter merging PR #4:```
error[E0063]: missing field `exposure_dedupe_max_keys` in initializer of `StatsigOptions`
--> statsig-ffi/src/statsig_options_c.rs:139:9
139 | Self {
| ^^^^ missing `exposure_dedupe_max_keys`
```
The other exhaustive struct literal in the same file (line 278) already uses `..StatsigOptions::new()` and is unaffected.
Test plan
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com