Skip to content

Commit

Permalink
fix typing + test errors
Browse files Browse the repository at this point in the history
  • Loading branch information
murilommen committed May 27, 2024
1 parent 555dcb7 commit 0c3b29e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/monitor/manager/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_validate(self, manager: MonitorManager) -> None:
assert manager.validate()

def test_failing_validation(self, monitor_setup: MonitorSetup) -> None:
monitor_setup.actions = [EmailRecipient(id="some_long_id", destination="someemail@email.com")]
monitor_setup.actions = [GlobalAction(target="some_long_id")]
monitor_setup.config.mode = "weird_mode" # type: ignore
monitor_setup.apply()

Expand Down
2 changes: 1 addition & 1 deletion whylabs_toolkit/helpers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def require(env: ConfigVars) -> str:

@staticmethod
def get_or_default(env: ConfigVars) -> str:
val = os.getenv(env.name, str(env.value))
val = os.getenv(env.name, env.value)
if not val:
raise TypeError(f"No default value for {env.name}")
return val
4 changes: 2 additions & 2 deletions whylabs_toolkit/monitor/manager/monitor_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def __init__(self, monitor_id: str, dataset_id: Optional[str] = None, config: Co
self._monitor_mode: Optional[Union[EveryAnomalyMode, DigestMode]] = None
self._monitor_actions: List[GlobalAction] = []
self._analyzer_schedule: Optional[Union[FixedCadenceSchedule, CronSchedule]] = None
self._target_columns: Optional[List[str]] = []
self._exclude_columns: Optional[List[str]] = []
self._target_matrix: Union[ColumnMatrix, DatasetMatrix] = ColumnMatrix(
include=self._target_columns, exclude=self._exclude_columns, segments=[]
)
Expand All @@ -45,8 +47,6 @@ def __init__(self, monitor_id: str, dataset_id: Optional[str] = None, config: Co
ConjunctionConfig,
DisjunctionConfig,
]
self._target_columns: Optional[List[str]] = []
self._exclude_columns: Optional[List[str]] = []
self._monitor_tags: Optional[List[str]] = []
self._analyzer_tags: Optional[List[str]] = []
self._analyzer_disable_target_rollup: Optional[bool] = None
Expand Down
2 changes: 1 addition & 1 deletion whylabs_toolkit/monitor/models/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class Monitor(NoExtrasBaseModel):
List[constr(min_length=3, max_length=32, regex="[0-9a-zA-Z\\-_]")] # type:ignore # noqa: F722
] = Field(None, description="A list of tags that are associated with the monitor.")
analyzerIds: Annotated[
str,
List[str],
Field(
title="AnalyzerIds",
description="The corresponding analyzer IDs for the conjunction.",
Expand Down

0 comments on commit 0c3b29e

Please sign in to comment.