Skip to content

Commit

Permalink
Rename field for ground truth source project
Browse files Browse the repository at this point in the history
  • Loading branch information
tiopramayudi committed Dec 2, 2024
1 parent af2e8b6 commit 429aeb9
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion api/models/model_observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions api/pkg/observability/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions api/storage/version_endpoint_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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 * * *",
Expand Down
6 changes: 3 additions & 3 deletions python/sdk/client/models/ground_truth_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down
9 changes: 6 additions & 3 deletions python/sdk/merlin/model_observability.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
class GroundTruthSource:
table_urn: str
event_timestamp_column: str
dwh_project: str
source_project: str


@autostr
@dataclass_json
Expand All @@ -29,6 +30,7 @@ class GroundTruthJob:
memory_limit: Optional[str] = None
grace_period_day: Optional[int] = None


@autostr
@dataclass_json
@dataclass
Expand All @@ -37,6 +39,7 @@ class PredictionLogIngestionResourceRequest:
cpu_request: Optional[str] = None
memory_request: Optional[str] = None


@autostr
@dataclass_json
@dataclass
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/sdk/test/model_observability_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion python/sdk/test/model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 429aeb9

Please sign in to comment.