-
Notifications
You must be signed in to change notification settings - Fork 5
Feat/schemas #167
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
Merged
Merged
Feat/schemas #167
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ca20036
wip: marhsmallow -> pydantic + no django
khvn26 f778ed8
wip: better error message
khvn26 b788bec
feat: add Rudderstack support
khvn26 f161481
chore: better attribute order
khvn26 c57e4f3
fix: typo
khvn26 72aef1d
chore: even better attribute order
khvn26 c58e528
chore: better code organisation
khvn26 573db18
feat: test for error message
khvn26 9116109
chore: update TODOs
khvn26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,11 @@ | ||
| from flag_engine.environments.models import EnvironmentAPIKeyModel, EnvironmentModel | ||
| from flag_engine.environments.schemas import EnvironmentAPIKeySchema, EnvironmentSchema | ||
|
|
||
| environment_schema = EnvironmentSchema() | ||
| environment_api_key_schema = EnvironmentAPIKeySchema() | ||
|
|
||
|
|
||
| def build_environment_model(environment_dict: dict) -> EnvironmentModel: | ||
| return environment_schema.load(environment_dict) | ||
| return EnvironmentModel.parse_obj(environment_dict) | ||
|
|
||
|
|
||
| def build_environment_api_key_model( | ||
| environment_key_dict: dict, | ||
| ) -> EnvironmentAPIKeyModel: | ||
| return environment_api_key_schema.load(environment_key_dict) | ||
| return EnvironmentAPIKeyModel.parse_obj(environment_key_dict) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| from dataclasses import dataclass | ||
| from typing import Optional | ||
|
|
||
| from pydantic import BaseModel | ||
|
|
||
| @dataclass | ||
| class IntegrationModel: | ||
| api_key: str = None | ||
| base_url: str = None | ||
| entity_selector: str = None | ||
|
|
||
| class IntegrationModel(BaseModel): | ||
| api_key: Optional[str] = None | ||
| base_url: Optional[str] = None | ||
| entity_selector: Optional[str] = None | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.