terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

Add `databricks_mlflow_experiment` data source

Open 840 opened this issue 2 years ago • 6 comments

Changes

Add databricks_mlflow_experiment data source

Tests

Created 3 tests for this data source

  • [x] make test run locally
  • [x] relevant change in docs/ folder
  • [x] covered with integration tests in internal/acceptance
  • [x] relevant acceptance tests are passing
  • [x] using Go SDK

Partially resolves #2301

840 avatar Jun 08 '23 16:06 840

Currently you can only fetch the mlflow_experiment data source using the name in this PR. I believe it would be nice to provide the option to fetch using the ID, as well. I have to read a bit more into this.

840 avatar Jun 08 '23 16:06 840

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (4213468) 83.57% compared to head (9b8c8be) 83.57%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2389      +/-   ##
==========================================
- Coverage   83.57%   83.57%   -0.01%     
==========================================
  Files         168      169       +1     
  Lines       15083    15107      +24     
==========================================
+ Hits        12606    12625      +19     
- Misses       1736     1739       +3     
- Partials      741      743       +2     
Files Coverage Δ
provider/provider.go 94.47% <100.00%> (+0.03%) :arrow_up:
mlflow/data_mlflow_experiment.go 91.30% <91.30%> (ø)

... and 1 file with indirect coverage changes

codecov-commenter avatar Jun 08 '23 16:06 codecov-commenter

@840 thank you for raising the PR. a couple of thoughts for the pending tasks

you could look at https://github.com/databricks/terraform-provider-databricks/blob/master/clusters/data_cluster.go for example of searching both by name & id

the Go SDK has GetExperiment method which takes an ExperimentId as well.

For acceptance tests, you could create an mlflow experiment and try to read it in the same block, similar to https://github.com/databricks/terraform-provider-databricks/blob/master/internal/acceptance/data_job_test.go

nkvuong avatar Jun 08 '23 17:06 nkvuong

Blocked by databricks/databricks-sdk-go#428

840 avatar Jun 12 '23 09:06 840

Will continue this week or early next week.

840 avatar Jan 04 '24 12:01 840

@mgyucht WIP tag removed, should be ready!

840 avatar Jan 12 '24 17:01 840