diff --git a/api/models/model_observability.go b/api/models/model_observability.go index 6a5ae0862..f75d894ca 100644 --- a/api/models/model_observability.go +++ b/api/models/model_observability.go @@ -20,7 +20,7 @@ type ModelObservability struct { type GroundTruthSource struct { TableURN string `json:"table_urn"` EventTimestampColumn string `json:"event_timestamp_column"` - DWHProject string `json:"dwh_project"` + SourceProject string `json:"source_project"` } // GroundTruthJob represents the configuration for a scheduled job. diff --git a/api/pkg/observability/deployment/deployment.go b/api/pkg/observability/deployment/deployment.go index 86bdaeca3..fa20b50e4 100644 --- a/api/pkg/observability/deployment/deployment.go +++ b/api/pkg/observability/deployment/deployment.go @@ -346,8 +346,8 @@ func (c *deployer) getResources(data *models.WorkerData) (corev1.ResourceList, c requests := c.resourceRequest.DeepCopy() limits := c.resourceLimit.DeepCopy() if data.ResourceRequest != nil { - if data.ResourceRequest.CPURequest != nil { - requests[corev1.ResourceCPU] = *data.ResourceRequest.CPURequest + if cpuReq := data.ResourceRequest.CPURequest; cpuReq != nil { + requests[corev1.ResourceCPU] = *cpuReq // remove default limits delete(limits, corev1.ResourceCPU) } diff --git a/api/storage/version_endpoint_storage_test.go b/api/storage/version_endpoint_storage_test.go index 664162f59..f016f3831 100644 --- a/api/storage/version_endpoint_storage_test.go +++ b/api/storage/version_endpoint_storage_test.go @@ -107,7 +107,7 @@ func TestVersionEndpointsStorage_GetModelObservability(t *testing.T) { expectedGroundTruthSource := &models.GroundTruthSource{ TableURN: "table_urn", EventTimestampColumn: "event_timestamp", - DWHProject: "dwh_project", + SourceProject: "dwh_project", } assert.Equal(t, expectedGroundTruthSource, modelObservability.GroundTruthSource) expectedGroundTruthob := &models.GroundTruthJob{ @@ -234,7 +234,7 @@ func populateVersionEndpointTable(db *gorm.DB) []*models.VersionEndpoint { GroundTruthSource: &models.GroundTruthSource{ TableURN: "table_urn", EventTimestampColumn: "event_timestamp", - DWHProject: "dwh_project", + SourceProject: "dwh_project", }, GroundTruthJob: &models.GroundTruthJob{ CronSchedule: "0 0 * * *", diff --git a/python/sdk/client/models/ground_truth_source.py b/python/sdk/client/models/ground_truth_source.py index 0d7807f5a..d82c3e75e 100644 --- a/python/sdk/client/models/ground_truth_source.py +++ b/python/sdk/client/models/ground_truth_source.py @@ -31,8 +31,8 @@ class GroundTruthSource(BaseModel): """ # noqa: E501 table_urn: StrictStr event_timestamp_column: StrictStr - dwh_project: StrictStr - __properties: ClassVar[List[str]] = ["table_urn", "event_timestamp_column", "dwh_project"] + source_project: StrictStr + __properties: ClassVar[List[str]] = ["table_urn", "event_timestamp_column", "source_project"] model_config = { "populate_by_name": True, @@ -84,7 +84,7 @@ def from_dict(cls, obj: Dict) -> Self: _obj = cls.model_validate({ "table_urn": obj.get("table_urn"), "event_timestamp_column": obj.get("event_timestamp_column"), - "dwh_project": obj.get("dwh_project") + "source_project": obj.get("source_project") }) return _obj diff --git a/python/sdk/merlin/model_observability.py b/python/sdk/merlin/model_observability.py index b0b5b17ff..4fdb92551 100644 --- a/python/sdk/merlin/model_observability.py +++ b/python/sdk/merlin/model_observability.py @@ -13,7 +13,8 @@ class GroundTruthSource: table_urn: str event_timestamp_column: str - dwh_project: str + source_project: str + @autostr @dataclass_json @@ -29,6 +30,7 @@ class GroundTruthJob: memory_limit: Optional[str] = None grace_period_day: Optional[int] = None + @autostr @dataclass_json @dataclass @@ -37,6 +39,7 @@ class PredictionLogIngestionResourceRequest: cpu_request: Optional[str] = None memory_request: Optional[str] = None + @autostr @dataclass_json @dataclass @@ -52,7 +55,7 @@ def to_model_observability_request(self) -> client.ModelObservability: ground_truth_source = client.GroundTruthSource( table_urn=self.ground_truth_source.table_urn, event_timestamp_column=self.ground_truth_source.event_timestamp_column, - dwh_project=self.ground_truth_source.dwh_project + source_project=self.ground_truth_source.source_project ) ground_truth_job = None @@ -116,7 +119,7 @@ def _ground_truth_source_from_response(cls, response: Optional[client.GroundTrut return GroundTruthSource( table_urn=response.table_urn, event_timestamp_column=response.event_timestamp_column, - dwh_project=response.dwh_project + source_project=response.source_project ) @classmethod diff --git a/python/sdk/test/model_observability_test.py b/python/sdk/test/model_observability_test.py index 817717e4f..bc04259b8 100644 --- a/python/sdk/test/model_observability_test.py +++ b/python/sdk/test/model_observability_test.py @@ -11,7 +11,7 @@ ground_truth_source=client.GroundTruthSource( table_urn="table_urn", event_timestamp_column="event_timestamp_column", - dwh_project="dwh_project" + source_project="dwh_project" ), ground_truth_job=client.GroundTruthJob( cron_schedule="cron_schedule", @@ -35,7 +35,7 @@ ground_truth_source=GroundTruthSource( table_urn="table_urn", event_timestamp_column="event_timestamp_column", - dwh_project="dwh_project" + source_project="dwh_project" ), ground_truth_job=GroundTruthJob( cron_schedule="cron_schedule", diff --git a/python/sdk/test/model_test.py b/python/sdk/test/model_test.py index 776b50bee..2ea2da9a7 100644 --- a/python/sdk/test/model_test.py +++ b/python/sdk/test/model_test.py @@ -182,7 +182,7 @@ ground_truth_source=cl.GroundTruthSource( table_urn="table_urn", event_timestamp_column="event_timestamp_column", - dwh_project="dwh_project", + source_project="dwh_project", ), ground_truth_job=cl.GroundTruthJob( cron_schedule="cron_schedule", diff --git a/swagger.yaml b/swagger.yaml index 7defb9820..8ae46e754 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -2480,12 +2480,12 @@ components: type: string event_timestamp_column: type: string - dwh_project: + source_project: type: string required: - table_urn - event_timestamp_column - - dwh_project + - source_project PredictionLogIngestionResourceRequest: type: object