Skip to content

Commit

Permalink
fixing some more linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rosiezou committed Jun 7, 2022
1 parent 2a30817 commit 327611c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions google/cloud/aiplatform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"HyperparameterTuningJob",
"Model",
"ModelEvaluation",
"ModelDeploymentMonitoringJob",
"PipelineJob",
"TabularDataset",
"Tensorboard",
Expand Down
10 changes: 4 additions & 6 deletions google/cloud/aiplatform/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1951,7 +1951,7 @@ def __init__(
location=location,
credentials=credentials,
)
self._gca_resource = self._get_gca_resource(resource_name=job_name)
self._gca_resource = self._get_gca_resource(resource_name=self.job_name)

@classmethod
def _parse_configs(
Expand Down Expand Up @@ -2055,7 +2055,7 @@ def _empty_constructor(
def create(
cls,
display_name: str,
endpoint: Union[str, "models.Endpoint"],
endpoint: Union[str, "aiplatform.Endpoint"],
objective_configs: Union[
model_monitoring.EndpointObjectiveConfig,
Dict[str, model_monitoring.EndpointObjectiveConfig],
Expand Down Expand Up @@ -2227,9 +2227,7 @@ def create(
_LOGGER.log_create_with_lro(cls)

if int(endpoint):
formatted_endpoint = (
f"projects/{project}/locations/{location}/endpoints/{endpoint}"
)
endpoint = f"projects/{project}/locations/{location}/endpoints/{endpoint}"

gapic_mdm_job = (
gca_model_deployment_monitoring_job.ModelDeploymentMonitoringJob(
Expand Down Expand Up @@ -2296,7 +2294,7 @@ def update(
) -> "ModelDeploymentMonitoringJob":
""""""
current_job = self.api_client.get_model_deployment_monitoring_job(
name=slef.model_deployment_monitoring_job_name
name=self.model_deployment_monitoring_job_name
)
update_mask: List[str] = []
if display_name:
Expand Down
16 changes: 8 additions & 8 deletions google/cloud/aiplatform/model_monitoring/objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,20 @@ def as_proto(self):
class _ObjectiveConfig(abc.ABC):
def __init__(
self,
skew_detection_config: Optional["model_monitoring._SkewDetectionConfig"] = None,
skew_detection_config: Optional[
"gca_model_monitoring._SkewDetectionConfig"
] = None,
drift_detection_config: Optional[
"model_monitoring._DriftDetectionConfig"
"gca_model_monitoring._DriftDetectionConfig"
] = None,
explanation_config: Optional["model_monitoring._ExplanationConfig"] = None,
explanation_config: Optional["gca_model_monitoring._ExplanationConfig"] = None,
):
self.skew_detection_config = skew_detection_config
self.drift_detection_config = drift_detection_config
self.explanation_config = explanation_config

def as_proto(self):
training_dataset = None
# print(self.skew_detection_config.target_field)
if self.skew_detection_config is not None:
training_dataset = (
gca_model_monitoring.ModelMonitoringObjectiveConfig.TrainingDataset(
Expand All @@ -136,7 +137,6 @@ def as_proto(self):
)
else:
training_dataset.dataset = self.skew_detection_config.data_source
# print(training_dataset)
return gca_model_monitoring.ModelMonitoringObjectiveConfig(
training_dataset=training_dataset,
training_prediction_skew_detection_config=self.skew_detection_config.as_proto(),
Expand Down Expand Up @@ -253,13 +253,13 @@ class EndpointObjectiveConfig(_ObjectiveConfig):
def __init__(
self,
skew_detection_config: Optional[
"model_monitoring.EndpointSkewDetectionConfig"
"gca_model_monitoring.EndpointSkewDetectionConfig"
] = None,
drift_detection_config: Optional[
"model_monitoring.EndpointDriftDetectionConfig"
"gca_model_monitoring.EndpointDriftDetectionConfig"
] = None,
explanation_config: Optional[
"model_monitoring.EndpointExplanationConfig"
"gca_model_monitoring.EndpointExplanationConfig"
] = None,
):
""""""
Expand Down

0 comments on commit 327611c

Please sign in to comment.