terraform-provider-databricks
terraform-provider-databricks copied to clipboard
Add a `databricks_table` data source
Changes
This adds a new data source to describe a Databricks table, to address the request in https://github.com/databricks/terraform-provider-databricks/issues/3148. I am not particularly familiar with the Databricks Terraform Provider repo, and not sure which styles are best to mimic. I opted to re-use the struct from the Databricks SDK, rather than implementing a new one. I don't see this pattern a lot in the repo, but it seems like recent changes to the SQL data source may have taken this approach.
Tests
I wanted to see if this approach of using the SDK structs is acceptable before writing tests. Go is not a language I normally work in, so it might take a bit of doing for me to figure out that part.
I did manually test it against a real Databricks workspace and confirm the return data shows up in my terraform.tfstate
- [ ]
make test
run locally - [ ] relevant change in
docs/
folder - [ ] covered with integration tests in
internal/acceptance
- [ ] relevant acceptance tests are passing
- [ ] using Go SDK
I fixed a formatting error and added some basic unit testing. I am not really set up for running integration tests yet. Setting that up seems like a lot of overhead to commit a change that just passes an SDK result through unmodified, so if someone already set up for integration tests could help me out that would be appreciated.
Please add at least a unit test...
Sorry, I did and forgot to commit it.. Should be there now.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 83.47%. Comparing base (
edbda2a
) to head (c9055a1
). Report is 4 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #3170 +/- ##
==========================================
+ Coverage 83.43% 83.47% +0.04%
==========================================
Files 176 177 +1
Lines 16223 16258 +35
==========================================
+ Hits 13536 13572 +36
+ Misses 1865 1864 -1
Partials 822 822
Files | Coverage Δ | |
---|---|---|
catalog/data_table.go | 100.00% <100.00%> (ø) |
|
provider/provider.go | 94.68% <100.00%> (+0.02%) |
:arrow_up: |
Please rebase to the latest main
branch to fix the conflict. The changes should be like this: https://github.com/databricks/terraform-provider-databricks/pull/3191/commits/e221fe7a142a2806bf702ff8a211d3caf325ec59
conflict should be fixed and switched to common.resource
you can always run make fmt && make lint
before committing...
Oh, I missed that documentation isn't a part of PR - please add the documentation as doc/data-sources/table.md
file.
I added a doc file - mostly copy/pasted from the Databricks SDK for Go docs.
@jdavidheiser can you please resolve conflicts in the provider?
fixed
Hi - just circling back on this, hoping it could get merged soon to prevent more conflicts.
Supersed by #3571