Skip to content
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

fix: object client methods can receive dict or list as default_value #134

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

federicobond
Copy link
Member

This PR

Updates client object methods to accept dict or list as default value.

@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Merging #134 (805089a) into main (d31b531) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #134   +/-   ##
=======================================
  Coverage   93.09%   93.09%           
=======================================
  Files          20       20           
  Lines         362      362           
=======================================
  Hits          337      337           
  Misses         25       25           
Flag Coverage Δ
unittests 93.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
open_feature/open_feature_client.py 96.47% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@hlipsig hlipsig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM I don't see anything wrong with it from a code perspective. This change is straighforward and easy to understand. I'm double checking there's not any obscure reason in our codebase that this shouldn't be done.

@Kavindu-Dodan
Copy link

@federicobond can we add few test cases to cover this scenario ? This will help to validate this change as well as not break this with future changes

@federicobond
Copy link
Member Author

@Kavindu-Dodan sure! Not sure what kind of tests are you referring to, but I did update the one I found that was missing the list case.

@federicobond
Copy link
Member Author

To get proper type testing we would have to run mypy or some other typechecker in some example code, but I think this exceeds the scope of this pull request.

Signed-off-by: Federico Bond <federicobond@gmail.com>
@federicobond
Copy link
Member Author

Replaced get_object_value for get_object_details in test case. Everything should be green now.

@toddbaert toddbaert requested a review from hlipsig July 6, 2023 15:16
@Kavindu-Dodan
Copy link

@Kavindu-Dodan sure! Not sure what kind of tests are you referring to, but I did update the one I found that was missing the list case.

Sorry for not being specific. I was referring to the handling list type and seems you already added that.

@beeme1mr beeme1mr merged commit 291581f into open-feature:main Jul 6, 2023
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.

6 participants