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

feat(python): add get_flag method #148

Merged
merged 5 commits into from
Mar 22, 2024

Conversation

KozyarValeriy
Copy link
Contributor

In this PR, I have added support for the get_flag API. I have also fixed several issues that violated PEP8 and added new rules for Ruff.

We use this API to get a specific flag, because it is expensive to request all flags when there are many of them. In our case, we sometimes need to get a single specific flag and don't want to get a list and sift through them all.

If there are actually no plans to implement this feature in the SDK, please let me know so I will remove these changes from the PR and keep the code style edits. If you do not think this is necessary, please let me know, and I will close this PR.

@KozyarValeriy KozyarValeriy requested a review from a team as a code owner March 22, 2024 14:24
Copy link
Contributor

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

this looks great to me @KozyarValeriy !! thank you for this!!

I'll update the other issues for the other languages (ie: #131) to include GetFlag in addition to ListFlags

@kodiakhq kodiakhq bot merged commit f31c6c9 into flipt-io:main Mar 22, 2024
6 checks passed
@flipt-release-bot flipt-release-bot bot mentioned this pull request Mar 22, 2024
@KozyarValeriy KozyarValeriy deleted the feat-add-get-flag-method branch March 22, 2024 17:41
@KozyarValeriy
Copy link
Contributor Author

KozyarValeriy commented Mar 22, 2024

I'm very sorry, but it has just occurred to me that this PR have broken backward compatibility with version 1.2.0 due to renaming params. I replaced camelCase with snake_case for parameters in Flag, ListParameters and PaginatedResponse models. The use of camelCase for Python is not recommended (pep8), so I have replaced it throughout the code. I needed to add BREAKING_CHANGES.md, but I had forgotten about it.

I have added some new rules for ruff so that in the future, the linter will not pass with incorrect parameter names.

I'm really sorry for any trouble this might have caused.

@markphelps
Copy link
Contributor

All good, no problem @KozyarValeriy !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants