|
1 | 1 | import dataclasses
|
2 | 2 | import logging
|
3 | 3 | from datetime import datetime
|
4 |
| -from typing import Any, Iterable, List, Optional, TypeVar |
| 4 | +from typing import Any, Dict, Iterable, List, Optional, TypeVar |
5 | 5 |
|
6 | 6 | from google.api_core.exceptions import GoogleAPICallError
|
7 | 7 | from google.cloud import aiplatform
|
@@ -140,8 +140,8 @@ def __init__(self, ctx: PipelineContext, config: VertexAIConfig):
|
140 | 140 | project=config.project_id, location=config.region, credentials=credentials
|
141 | 141 | )
|
142 | 142 | self.client = aiplatform
|
143 |
| - self.endpoints: Optional[dict[str, List[Endpoint]]] = None |
144 |
| - self.datasets: Optional[dict[str, VertexAiResourceNoun]] = None |
| 143 | + self.endpoints: Optional[Dict[str, List[Endpoint]]] = None |
| 144 | + self.datasets: Optional[Dict[str, VertexAiResourceNoun]] = None |
145 | 145 |
|
146 | 146 | def get_report(self) -> SourceReport:
|
147 | 147 | return self.report
|
@@ -395,7 +395,7 @@ def _search_dataset(self, dataset_id: str) -> Optional[VertexAiResourceNoun]:
|
395 | 395 | ]
|
396 | 396 |
|
397 | 397 | if self.datasets is None:
|
398 |
| - self.datasets = dict[str, VertexAiResourceNoun]() |
| 398 | + self.datasets: Dict[str, VertexAiResourceNoun] = {} |
399 | 399 |
|
400 | 400 | for dtype in dataset_types:
|
401 | 401 | dataset_class = getattr(self.client.datasets, dtype)
|
@@ -633,7 +633,7 @@ def _search_endpoint(self, model: Model) -> List[Endpoint]:
|
633 | 633 | Search for an endpoint associated with the model.
|
634 | 634 | """
|
635 | 635 | if self.endpoints is None:
|
636 |
| - endpoint_dict = dict[str, List[Endpoint]]() |
| 636 | + endpoint_dict:Dict[str, List[Endpoint]] = {} |
637 | 637 | for endpoint in self.client.Endpoint.list():
|
638 | 638 | for resource in endpoint.list_models():
|
639 | 639 | if resource.model not in endpoint_dict:
|
|
0 commit comments