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: Allow string values for FlagEvaluationDetails.reason and FlagResolutionDetails.reason #264

Merged
merged 3 commits into from
Jan 29, 2024

Conversation

keelerm84
Copy link
Contributor

This PR

Expands the types allowed for reason on FlagEvaluationDetails and FlagResolutionDetails to include both Reason and str types.

Related Issues

Fixes #262

Notes

Related to spec issue: open-feature/spec#236

…gResolutionDetails.reason`

Signed-off-by: Matthew Keeler <mkeeler@launchdarkly.com>
Copy link

codecov bot commented Jan 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f1b0839) 93.89% compared to head (fd30717) 93.89%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #264   +/-   ##
=======================================
  Coverage   93.89%   93.89%           
=======================================
  Files          16       16           
  Lines         442      442           
=======================================
  Hits          415      415           
  Misses         27       27           
Flag Coverage Δ
unittests 93.89% <100.00%> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@gruebel gruebel left a comment

Choose a reason for hiding this comment

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

Nice job 🍻

Copy link
Member

@lukas-reining lukas-reining left a comment

Choose a reason for hiding this comment

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

Not a huge python expert but the change and tests look good!

Copy link
Member

@federicobond federicobond left a comment

Choose a reason for hiding this comment

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

Hi @keelerm84! Thank you for your contribution. Change LGTM, but I am lost on what the test is supposed to assert.

If it's just a type check then it should be already covered by mypy. Would any of the tests break if you reverted the type change?

Signed-off-by: Matthew Keeler <mkeeler@launchdarkly.com>
@keelerm84
Copy link
Contributor Author

Hi @keelerm84! Thank you for your contribution. Change LGTM, but I am lost on what the test is supposed to assert.

If it's just a type check then it should be already covered by mypy. Would any of the tests break if you reverted the type change?

That's a good point. I've removed the useless test and will rely on mypy as suggested.

@federicobond federicobond merged commit 5ef6ca1 into open-feature:main Jan 29, 2024
11 checks passed
@keelerm84 keelerm84 deleted the fix/reason-as-str branch January 29, 2024 17:03
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.

FlagResolutionDetails reason field should accept any string
5 participants