-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabling a User-defined Config object as input (#20)
* api calls now can be configured with strings * updating whylabs_client * test validate wih group columns * enforcing group columns should only contain one element * putting guardrail for group_column typo * updating the schema.json file
- Loading branch information
1 parent
2177314
commit 599d983
Showing
21 changed files
with
561 additions
and
195 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "whylabs-toolkit" | ||
version = "0.0.4" | ||
version = "0.0.5" | ||
description = "Whylabs CLI and Helpers package." | ||
authors = ["Anthony Naddeo <[email protected]>", "Murilo Mendonca <[email protected]>"] | ||
license = "Apache-2.0 license" | ||
|
@@ -10,7 +10,7 @@ include = ["whylabs_toolkit/monitor/schema/schema.json"] | |
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
whylabs-client = "^0.4.2" | ||
whylabs-client = "^0.4.4" | ||
types-pytz = "^2022.7.1.0" | ||
pydantic = "^1.10.4" | ||
whylogs = "^1.1.26" | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,2 +1,3 @@ | ||
def test_import() -> None: | ||
import whylabs_toolkit.helpers.client | ||
from whylabs_toolkit.monitor import MonitorManager, MonitorSetup |
This file contains 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from whylabs_toolkit.helpers.config import UserConfig | ||
from whylabs_toolkit.helpers.utils import get_dataset_profile_api, get_models_api, get_notification_api | ||
|
||
|
||
def test_get_apis_with_different_config(user_config: UserConfig) -> None: | ||
dataset_api = get_dataset_profile_api(config = user_config) | ||
assert dataset_api.api_client.configuration.api_key["ApiKeyAuth"] == user_config.api_key | ||
|
||
models_api = get_models_api(config = user_config) | ||
assert models_api.api_client.configuration.api_key["ApiKeyAuth"] == user_config.api_key | ||
|
||
notifications_api = get_notification_api(config = user_config) | ||
assert notifications_api.api_client.configuration.api_key["ApiKeyAuth"] == user_config.api_key |
This file contains 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 |
---|---|---|
|
@@ -26,9 +26,9 @@ def test_dump(self, manager: MonitorManager) -> None: | |
def test_validate(self, manager: MonitorManager) -> None: | ||
assert manager.validate() | ||
|
||
def test_failing_validation(self, monitor_setup) -> None: | ||
def test_failing_validation(self, monitor_setup: MonitorSetup) -> None: | ||
monitor_setup.actions = [EmailRecipient(id="some_long_id", destination="[email protected]")] | ||
monitor_setup.config.mode = "weird_mode" | ||
monitor_setup.config.mode = "weird_mode" # type: ignore | ||
monitor_setup.apply() | ||
|
||
manager = MonitorManager(setup=monitor_setup) | ||
|
@@ -70,9 +70,13 @@ def setUp(self) -> None: | |
self.notifications_api = MagicMock() | ||
self.notifications_api.list_notification_actions.return_value = [] | ||
|
||
self.models_api = MagicMock() | ||
self.monitor_api = MagicMock() | ||
|
||
self.monitor_manager = MonitorManager(setup = self.monitor_setup, notifications_api=self.notifications_api, models_api=self.models_api) | ||
self.monitor_manager = MonitorManager( | ||
setup = self.monitor_setup, | ||
notifications_api=self.notifications_api, | ||
monitor_api=self.monitor_api | ||
) | ||
|
||
|
||
def test_notification_actions_are_updated(self) -> None: | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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.