|
1 | 1 | import dataclasses
|
2 | 2 | import logging
|
3 | 3 | from datetime import datetime
|
4 |
| -from typing import Any, Iterable, List, Optional, TypeVar, Union |
| 4 | +from typing import Any, Dict, Iterable, List, Optional, TypeVar, Union |
5 | 5 |
|
6 | 6 | from google.api_core.exceptions import GoogleAPICallError
|
7 | 7 | from google.cloud import aiplatform
|
@@ -157,8 +157,8 @@ def __init__(self, ctx: PipelineContext, config: VertexAIConfig):
|
157 | 157 | project=config.project_id, location=config.region, credentials=credentials
|
158 | 158 | )
|
159 | 159 | self.client = aiplatform
|
160 |
| - self.endpoints: Optional[dict[str, List[Endpoint]]] = None |
161 |
| - self.datasets: Optional[dict[str, VertexAiResourceNoun]] = None |
| 160 | + self.endpoints: Optional[Dict[str, List[Endpoint]]] = None |
| 161 | + self.datasets: Optional[Dict[str, VertexAiResourceNoun]] = None |
162 | 162 | self.experiments: Optional[List[Experiment]] = None
|
163 | 163 |
|
164 | 164 | def get_report(self) -> SourceReport:
|
@@ -560,7 +560,7 @@ def _search_dataset(self, dataset_id: str) -> Optional[VertexAiResourceNoun]:
|
560 | 560 | ]
|
561 | 561 |
|
562 | 562 | if self.datasets is None:
|
563 |
| - self.datasets = dict[str, VertexAiResourceNoun]() |
| 563 | + self.datasets = {} |
564 | 564 |
|
565 | 565 | for dtype in dataset_types:
|
566 | 566 | dataset_class = getattr(self.client.datasets, dtype)
|
@@ -799,7 +799,7 @@ def _search_endpoint(self, model: Model) -> List[Endpoint]:
|
799 | 799 | Search for an endpoint associated with the model.
|
800 | 800 | """
|
801 | 801 | if self.endpoints is None:
|
802 |
| - endpoint_dict = dict[str, List[Endpoint]]() |
| 802 | + endpoint_dict: Dict[str, List[Endpoint]] = {} |
803 | 803 | for endpoint in self.client.Endpoint.list():
|
804 | 804 | for resource in endpoint.list_models():
|
805 | 805 | if resource.model not in endpoint_dict:
|
|
0 commit comments