-
Notifications
You must be signed in to change notification settings - Fork 33
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
base: main
Are you sure you want to change the base?
Conversation
libs/dyn/convert/struct_info.go
Outdated
continue | ||
} | ||
if name == "-" { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Snapshot *ResourceLakehouseMonitorSnapshot `json:"snapshot,omitempty"` | ||
TimeSeries *ResourceLakehouseMonitorTimeSeries `json:"time_series,omitempty"` | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terraform LHM: databricks/terraform-provider-databricks#3238
bundle/deploy/terraform/tfdyn/convert_lakehouse_monitor_test.go
Outdated
Show resolved
Hide resolved
} | ||
return lakehouseMonitorAllDocs, nil | ||
} | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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/struct_info.go
Outdated
continue | ||
} | ||
if name == "-" { |
There was a problem hiding this comment.
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?
There was a problem hiding this 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.
8bbbcdb
to
ea7b74b
Compare
Regarding the hacky approach |
Tests are failing because of the change to not avoid json |
There was a problem hiding this 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
assertExpectedLakehouseMonitor(t, p) | ||
} | ||
|
||
func TestLakehouseMonitorStaging(t *testing.T) { |
There was a problem hiding this comment.
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
libs/dyn/convert/struct_info.go
Outdated
continue | ||
} | ||
if name == "-" { |
There was a problem hiding this comment.
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
a915754
to
cfe77aa
Compare
Codecov ReportAttention: Patch coverage is
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. |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//Monitor 1 | |
// Monitor 1 |
} | ||
return lakehouseMonitorAllDocs, nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping on this.
bundle/tests/monitor/databricks.yml
Outdated
table_name: "main.test.prod" | ||
output_schema_name: "prod" | ||
inference_log: | ||
granularities: ["1 hour"] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
libs/dyn/convert/struct_info.go
Outdated
continue | ||
} | ||
if name == "-" { |
There was a problem hiding this comment.
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.
8d4a1a9
to
c240c31
Compare
Changes
Support Lakehouse Monitoring in Bundles
Testing
Unit Tests