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

Added DBC format support for databricks_notebook #989

Merged
merged 2 commits into from
Dec 20, 2021
Merged

Added DBC format support for databricks_notebook #989

merged 2 commits into from
Dec 20, 2021

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Dec 18, 2021

Fixes #988

locals {
  url = "https://files/XYZ.dbc"
}

// though this can be replaced with data http & local file
resource "null_resource" "dbc" {
  triggers = {
    on_version_change = local.url
  }

  provisioner "local-exec" {
    command = "curl -o ${path.root}/.terraform/import.dbc ${local.url}"
  }

  provisioner "local-exec" {
    when    = destroy
    command = "rm ${path.root}/.terraform/import.dbc"
  }
}

// "downloaded_file" module then... or hack with https://registry.terraform.io/providers/anschoewe/curl/latest/docs/data-sources/curl
data "null_data_source" "values" {
  inputs = {
    x = "${path.root}/.terraform/import.dbc"
  }
  depends_on = [null_resource.dbc]
}

data "databricks_current_user" "me" {
}

resource "databricks_notebook" "lesson" {
  source = data.null_data_source.values.outputs["x"]
  path = "${data.databricks_current_user.me.home}/Foo" 
}

@codecov
Copy link

codecov bot commented Dec 18, 2021

Codecov Report

Merging #989 (74c0c8b) into master (097c9fe) will increase coverage by 0.05%.
The diff coverage is 94.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #989      +/-   ##
==========================================
+ Coverage   85.79%   85.85%   +0.05%     
==========================================
  Files         103      103              
  Lines        9291     9301      +10     
==========================================
+ Hits         7971     7985      +14     
+ Misses        802      799       -3     
+ Partials      518      517       -1     
Impacted Files Coverage Δ
workspace/data_notebook_paths.go 86.66% <ø> (+18.24%) ⬆️
workspace/file_resource.go 96.29% <ø> (ø)
workspace/resource_notebook.go 88.97% <93.54%> (+1.36%) ⬆️
workspace/data_notebook.go 88.67% <100.00%> (ø)

@nfx nfx added this to the v0.4.2 milestone Dec 18, 2021
@nfx nfx requested a review from alexott December 20, 2021 10:07
@nfx nfx merged commit 7d971f4 into master Dec 20, 2021
@nfx nfx deleted the issue/988 branch December 20, 2021 10:54
@nfx nfx mentioned this pull request Dec 24, 2021
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
* Added DBC format support for `databricks_notebook`

Fixes databricks#988
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.

Manage DBC archive notebooks
1 participant