- 
                Notifications
    
You must be signed in to change notification settings  - Fork 23
 
fix: return default dict if not meta provided #304
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
          Summary of ChangesHello @sysradium, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the OpenFeature OFREP provider by preventing a  Highlights
 Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either  
 Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a  Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
  | 
    
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.
Code Review
This pull request effectively resolves a KeyError that occurs when the metadata key is absent from the OFREP provider's response. The use of data.get("metadata", {}) is a correct and idiomatic way to handle optional dictionary keys in Python. While the fix is good, I've added a comment suggesting the addition of a unit test to cover this specific scenario, which will help prevent future regressions and ensure the provider is robust against this type of API response variation.
        
          
                providers/openfeature-provider-ofrep/src/openfeature/contrib/provider/ofrep/__init__.py
          
            Show resolved
            Hide resolved
        
      Signed-off-by: sysradium <sysradium@users.noreply.github.com>
2b3f798    to
    117aae8      
    Compare
  
    
          Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@            Coverage Diff             @@
##             main     #304      +/-   ##
==========================================
- Coverage   90.73%   86.40%   -4.33%     
==========================================
  Files           6        1       -5     
  Lines         205      103     -102     
==========================================
- Hits          186       89      -97     
+ Misses         19       14       -5     ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
| 
           @sysradium change looks good. as far as I can tell it also reflects the specs to return an empty record. can you check the DCO part, it looks like you forgot to sign-off the last commit.  | 
    
b9e28d8    to
    2b99b0f      
    Compare
  
    | 
           @gruebel yeah, I did on the first commit, but forgot to do it on the last one.  | 
    
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.
thanks 🍻

When using with flipt I observed that since it does not always return
metadatakey in the payload we end up having this:I suggest just to have a fallback to a empty dict?
The test example:
Versions: