Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfczekalski committed Aug 5, 2024
1 parent ae1f1e8 commit 3e758b8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions kedro_vertexai/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from importlib import import_module
from inspect import signature
from typing import Dict, List, Optional, Union
from typing import Dict, List, Optional

from pydantic import BaseModel, validator
from pydantic.networks import IPvAnyAddress
Expand Down Expand Up @@ -218,7 +218,7 @@ class ScheduleConfig(BaseModel):
start_time: Optional[str] = None
end_time: Optional[str] = None
allow_queueing: Optional[bool] = False
max_run_count: Optional[Union[int, None]] = None
max_run_count: Optional[int] = None
max_concurrent_run_count: Optional[int] = 1


Expand All @@ -238,7 +238,7 @@ class RunConfig(BaseModel):
node_selectors: Optional[Dict[str, Dict[str, str]]] = {}
dynamic_config_providers: Optional[List[DynamicConfigProviderConfig]] = []
mlflow: Optional[MLFlowVertexAIConfig] = None
schedules: Dict[str, ScheduleConfig]
schedules: Optional[Dict[str, ScheduleConfig]] = None

def resources_for(self, node: str, tags: Optional[set] = None):
default_config = self.resources["__default__"].dict()
Expand Down
9 changes: 9 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
size: 3Gi
access_modes: [ReadWriteOnce]
keep: True
# schedules:
# default_schedule:
# cron_expression: "0 * * * *"
# timezone: Etc/UTC
# start_time: null
# end_time: null
# allow_queueing: false
# max_run_count: null
# max_concurrent_run_count: 1
mlflow:
request_header_provider_params:
service_account: [email protected]
Expand Down
4 changes: 1 addition & 3 deletions tests/test_vertex_ai_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@


class TestVertexAIClient(unittest.TestCase):
@patch("kedro_vertexai.client.CloudSchedulerClient")
def create_client(self, cloud_scheduler_client_mock):
self.cloud_scheduler_client_mock = cloud_scheduler_client_mock.return_value
def create_client(self):
config = PluginConfig.parse_obj(
{
"project_id": "PROJECT_ID",
Expand Down

0 comments on commit 3e758b8

Please sign in to comment.