-
Notifications
You must be signed in to change notification settings - Fork 45
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
Handle None return from feature store .all() #99
Handle None return from feature store .all() #99
Conversation
Hmm. I agree that the current implementation is a problem, but I'm not sure if this is the best place to fix it - especially if that means having to raise and catch another exception. The other option would be to just change the feature store so it returns an empty dict, rather than None, for these error conditions. That would be consistent with the behavior of the single-item |
On the other hand... your approach will result in setting the |
Actually I have one request: could you change the exception message from "flags_map is None, aborting" to "feature store error"? That would be more descriptive - no one should need to know this particular variable name. The details of the error should have already been logged by the feature store at this point. |
Potentially dumb question: is the condition on this line actually an error / invalid state? Is there a different valid state the store is expected to be in if it's initialized but empty? https://github.com/launchdarkly/python-client/blob/master/ldclient/redis_feature_store.py#L72 |
Well, this is more confusing than I thought. I was thinking that Unfortunately, the redis-py documentation says nothing at all about how |
Indeed, |
add experimentation event overrides for rules and fallthrough
Fixes a bug where
self._store.all()
returnsNone
without throwing an Exception. This would go on to immediately fail on line 328 asNone
does not have.items()
. Instead, this makes us go through the established error handler and bail out withFeatureFlagsState(False)
cc @mattbriancon