Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Lakehouse monitoring in bundles #1307

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

aravind-segu
Copy link

Changes

Support Lakehouse Monitoring in Bundles

Testing

Unit Tests

continue
}
if name == "-" {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The full_name parameter is a url parameter. Therefore the json is -. Added a case that if the json is - uses the Key name to use get the json name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty hacky. Can't we use the url tag of the field?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pietern url tag is also - for path params but non-empty for query params. But I agree that it's pretty hacky and needs to be addressed on Go SDK side any maybe by introducing a new annotation like path: or so

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this fix that looks at the URL we can come up with something else specifically for monitors.

This fix will break down in other cases so I rather not have a generic solution.

@pietern pietern changed the title [MLOPS-651] Support Lakehouse monitoring in Bundles Support Lakehouse monitoring in bundles Mar 25, 2024
Snapshot *ResourceLakehouseMonitorSnapshot `json:"snapshot,omitempty"`
TimeSeries *ResourceLakehouseMonitorTimeSeries `json:"time_series,omitempty"`
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a similar PR to add LHM to the TF provider? I don't see it in the released versions yet.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bundle/config/resources.go Outdated Show resolved Hide resolved
}
return lakehouseMonitorAllDocs, nil
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not generated as part of the main resources?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping on this.

libs/dyn/convert/normalize.go Outdated Show resolved Hide resolved
libs/dyn/convert/normalize.go Outdated Show resolved Hide resolved
continue
}
if name == "-" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty hacky. Can't we use the url tag of the field?

Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. Please reach out directly if you want to chat about the approach.

@aravind-segu
Copy link
Author

Regarding the hacky approach This looks pretty hacky. Can't we use the url tag of the field?. The url field is empty as well. CreateMonitor takes in the table name as part of the query parameters and it is not passed in json body.

@aravind-segu
Copy link
Author

Tests are failing because of the change to not avoid json - parameters in struct_info. How can we solve this? Is it ok to modify the tests?

Copy link
Contributor

@andrewnester andrewnester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FullName needs to be renamed to TableName because it was renamed in a new GoSDK version being used

bundle/deploy/terraform/convert_test.go Outdated Show resolved Hide resolved
bundle/deploy/terraform/convert_test.go Outdated Show resolved Hide resolved
assertExpectedLakehouseMonitor(t, p)
}

func TestLakehouseMonitorStaging(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 3 tests are doing the same thing, we can just have 1 test the overrides.
Instead please add the test with overriding other options like output_schema_name and inference_log

continue
}
if name == "-" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pietern url tag is also - for path params but non-empty for query params. But I agree that it's pretty hacky and needs to be addressed on Go SDK side any maybe by introducing a new annotation like path: or so

bundle/deploy/terraform/tfdyn/convert_lakehouse_monitor.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 6, 2024

Codecov Report

Attention: Patch coverage is 38.04348% with 57 lines in your changes are missing coverage. Please review.

Project coverage is 53.82%. Comparing base (e22dd8a) to head (49ffedc).
Report is 118 commits behind head on main.

Files Patch % Lines
bundle/config/resources.go 0.00% 15 Missing and 3 partials ⚠️
bundle/schema/openapi.go 0.00% 16 Missing ⚠️
libs/dyn/convert/struct_info.go 18.18% 8 Missing and 1 partial ⚠️
bundle/deploy/terraform/convert.go 70.00% 5 Missing and 1 partial ⚠️
.../deploy/terraform/tfdyn/convert_quality_monitor.go 64.70% 4 Missing and 2 partials ⚠️
bundle/deploy/terraform/interpolate.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1307      +/-   ##
==========================================
+ Coverage   52.25%   53.82%   +1.56%     
==========================================
  Files         317      347      +30     
  Lines       18004    20013    +2009     
==========================================
+ Hits         9408    10771    +1363     
- Misses       7903     8442     +539     
- Partials      693      800     +107     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -145,6 +148,9 @@ func TestProcessTargetModeDevelopment(t *testing.T) {

// Registered model 1
assert.Equal(t, "dev_lennart_registeredmodel1", b.Config.Resources.RegisteredModels["registeredmodel1"].Name)

//Monitor 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//Monitor 1
// Monitor 1

bundle/config/mutator/run_as_test.go Outdated Show resolved Hide resolved
bundle/deploy/terraform/convert_test.go Outdated Show resolved Hide resolved
}
return lakehouseMonitorAllDocs, nil
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping on this.

table_name: "main.test.prod"
output_schema_name: "prod"
inference_log:
granularities: ["1 hour"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lists are appended to for overrides, implying we would see 2 granularities here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they are appended, for the user this would granularities for aggregating data into time windows. Should we add a comment in the documentation somewhere?

continue
}
if name == "-" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this fix that looks at the URL we can come up with something else specifically for monitors.

This fix will break down in other cases so I rather not have a generic solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants