-
Notifications
You must be signed in to change notification settings - Fork 7
Use rust_decider.RustDecider
in get_variant()
& get_variant_without_expose()
#79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
438265d
to
e75666e
Compare
869bc8e
to
ba939da
Compare
tests/decider_tests.py
Outdated
'Rust decider has initialization error: Decider initialization failed: Json error: "invalid type: string \\"1\\"' | ||
'rust_decider.init() has error: Decider initialization failed: Partially loaded decider: 1 features failed to load.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gshipilov until I incorporate de-structuring the hashmap of feature specific errors, we're currently losing error info, we're losing that info for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I think this is ok. I'm assuming restructuring the partial error is gonna happen relatively soon, and we have some workarounds for this if we end up in an incident.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Although the linter looks unhappy.
Summary
This pr shows the updates required to incorporate the new decider python shims once they have been merged.
These changes have been tested locally but CI will not pass until the upstream decider-py PR is merged & new
reddit-decider
package has been released.Changes
Decider()
constructor no longer takes a filewatcher param, since an instance of it should not update its experiment config json mid-request.Instead an instance of
rust_decider.RustDecider
class is passed in, which was initialized by the filewatcher in theDeciderContextFactory
.rust_decider.RustDecider#choose()
, instead ofrust_decider.make_ctx()
/rust_decider.choose()
functions, inget_variant()
/get_variant_without_expose()
"Feature "{feature_name}" not found."
once viawarnings.warn()
to alleviate logs if the feature was disabled and not found in config (to maintain parity w/ reddit_experiments)